Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-94 (对生成代码的控制不恰当(代码注入)) — Vulnerability Class 1335

1335 vulnerabilities classified as CWE-94 (对生成代码的控制不恰当(代码注入)). AI Chinese analysis included.

CWE-94 represents a critical code injection weakness where software constructs executable code using untrusted input without proper sanitization. Attackers typically exploit this vulnerability by injecting malicious scripts or commands into user-supplied fields, such as web forms or API parameters, which the application then executes directly. This allows adversaries to bypass security controls, steal sensitive data, or gain unauthorized administrative access to the underlying system. To prevent such exploits, developers must rigorously validate and sanitize all external inputs, ensuring that only expected characters are processed. Implementing strict allow-listing strategies, utilizing parameterized queries for database interactions, and avoiding dynamic code execution functions like eval() are essential defensive measures. By treating all user input as potentially hostile and applying robust encoding techniques, organizations can effectively neutralize injection vectors and maintain application integrity.

MITRE CWE Description
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Common Consequences (4)
Access ControlBypass Protection Mechanism
In some cases, injectable code controls authentication; this may lead to a remote vulnerability.
Access ControlGain Privileges or Assume Identity
Injected code can access resources that the attacker is directly prevented from accessing.
Integrity, Confidentiality, AvailabilityExecute Unauthorized Code or Commands
When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. As a result, code injection can often result in the execution of arbitrary code. Code injection attacks can…
Non-RepudiationHide Activities
Often the actions performed by injected control code are unlogged.
Mitigations (5)
Architecture and DesignRefactor your program so that you do not have to dynamically generate code.
Architecture and DesignRun your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product. Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection. This may not be a feasible solution, and it only limits the impact to the operating s…
ImplementationAssume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range…
TestingUse dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
OperationRun the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Examples (2)
This example attempts to write user messages to a message file and allow users to view them.
$MessageFile = "messages.out"; if ($_GET["action"] == "NewMessage") { $name = $_GET["name"]; $message = $_GET["message"]; $handle = fopen($MessageFile, "a+"); fwrite($handle, "<b>$name</b> says '$message'<hr>\n"); fclose($handle); echo "Message Saved!<p>\n"; } else if ($_GET["action"] == "ViewMessages") { include($MessageFile); }
Bad · PHP
name=h4x0r message=%3C?php%20system(%22/bin/ls%20-l%22);?%3E
Attack
edit-config.pl: This CGI script is used to modify settings in a configuration file.
use CGI qw(:standard); sub config_file_add_key { my ($fname, $key, $arg) = @_; # code to add a field/key to a file goes here } sub config_file_set_key { my ($fname, $key, $arg) = @_; # code to set key to a particular file goes here } sub config_file_delete_key { my ($fname, $key, $arg) = @_; # code to delete key from a particular file goes here } sub handleConfigAction { my ($fname, $action) = @_; my $key = param('key'); my $val = param('val'); # this is super-efficient code, especially if you have to invoke # any one of dozens of different functions! my $code = "config_file_$action_key(\$fnam
Bad · Perl
add_key(",","); system("/bin/ls");
Attack
CVE IDTitleCVSSSeverityPublished
CVE-2025-62023 WordPress s2Member plugin <= 250905 - Remote Code Execution (RCE) vulnerability — s2Member 9.0 Critical2025-10-22
CVE-2025-60206 WordPress Alone theme <= 7.8.3 - Remote Code Execution (RCE) vulnerability — Alone 10.0 Critical2025-10-22
CVE-2025-52756 WordPress WP Last Modified Info plugin <= 1.9.4 - Remote Code Execution (RCE) vulnerability — WP Last Modified Info 7.4 High2025-10-22
CVE-2025-49926 WordPress Kalium theme <= 3.25 - Arbitrary Code Execution vulnerability — Kalium 7.2 High2025-10-22
CVE-2025-8848 HTML Injection in Accept-Language Header in danny-avila/librechat — danny-avila/librechat 6.1AIMediumAI2025-10-22
CVE-2025-62429 ClipBucket v5 executes arbitrary PHP code — clipbucket-v5 7.2 High2025-10-20
CVE-2025-11905 yanyutao0402 ChanCMS gather.js getArticle code injection — ChanCMS 6.3 Medium2025-10-17
CVE-2025-62416 bagisto - Server Side Template Injection (SSTI) in Product Description — bagisto 5.1 Medium2025-10-16
CVE-2025-11548 ibi WebFOCUS - Unauthenticated RCE Vulnerability — WebFOCUS 9.8AICriticalAI2025-10-14
CVE-2025-31365 Fortinet FortiClientMac 代码注入漏洞 — FortiClientMac 5.5 Medium2025-10-14
CVE-2025-46581 ZTE ZXCDN product has a Struts RCE Vulnerability — ZXCDN 9.8 Critical2025-10-14
CVE-2025-41699 Phoenix Contact: Security Advisory for CHARX SEC-3xxx charging controllers — CHARX SEC-3150 8.8 High2025-10-14
CVE-2025-42901 Code Injection vulnerability in SAP Application Server for ABAP (BAPI Browser) — SAP Application Server for ABAP (BAPI Browser) 5.4 Medium2025-10-14
CVE-2025-61929 Cherry Studio allows one-click on a specific URL to cause a command to execute — cherry-studio 9.7 Critical2025-10-10
CVE-2025-61927 Happy-DOM has VM Context Escape — happy-dom 9.0AICriticalAI2025-10-10
CVE-2025-11539 Arbitrary Code Execution in Grafana Image Renderer Plugin — grafana-image-renderer 9.9 Critical2025-10-09
CVE-2025-61774 PyVista has Dependency Confusion Vulnerability in that leads to RCE — pyvista 9.8AICriticalAI2025-10-06
CVE-2025-11344 ILIAS Certificate Import code injection — ILIAS 6.3 Medium2025-10-06
CVE-2025-54374 Eidos: One-click Remote Code Execution through Custom URL Handling — eidos 8.8 High2025-10-03
CVE-2025-46818 Redis: Authenticated users can execute LUA scripts as a different user — redis 6.0 Medium2025-10-03
CVE-2025-61590 Cursor is vulnerable to RCE via .code-workspace files using Prompt Injection — cursor 7.5 High2025-10-03
CVE-2025-59536 Claude Code's startup trust dialog could lead to Command Execution attack — claude-code 8.8AIHighAI2025-10-03
CVE-2025-61588 risc0 vulnerable to arbitrary code execution in guest via memory safety failure in `sys_read` — risc0 8.8AIHighAI2025-10-01
CVE-2025-59954 Knowage Contains a Remote Code Execution Vulnerability — Knowage-Server 9.8 -2025-09-29
CVE-2025-60114 WordPress YayCurrency plugin <= 3.3.1 - Remote Code Execution (RCE) vulnerability — YayCurrency 6.6 Medium2025-09-26
CVE-2025-10993 MuYuCMS Template Management admin.php code injection — MuYuCMS 4.7 Medium2025-09-26
CVE-2025-59823 Gardener providers vulnerable to code injection when Terraformer is used for infrastructure provisioning — gardener-extension-provider-aws 7.2AIHighAI2025-09-25
CVE-2025-23354 NVIDIA Megatron-LM 代码注入漏洞 — Megatron-LM 7.8 High2025-09-24
CVE-2025-23353 NVIDIA Megatron-LM 代码注入漏洞 — Megatron-LM 7.8 High2025-09-24
CVE-2025-23349 NVIDIA Megatron-LM 代码注入漏洞 — Megatron-LM 7.8 High2025-09-24

Vulnerabilities classified as CWE-94 (对生成代码的控制不恰当(代码注入)) represent 1335 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.