BaseDraftTop 25 #11
CWE-94Improper Control of Generation of Code ('Code Injection')
Category: injection
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 Control — Bypass Protection MechanismIn some cases, injectable code controls authentication; this may lead to a remote vulnerability.
- Access Control — Gain Privileges or Assume IdentityInjected code can access resources that the attacker is directly prevented from accessing.
- Integrity / Confidentiality / Availability — Execute Unauthorized Code or CommandsWhen 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 also lead to loss of data integrity in nearly all cases, since the control-plane data injected is always incidental to data recall or writing.
- Non-Repudiation — Hide ActivitiesOften the actions performed by injected control code are unlogged.
Potential mitigations· 5
- [Architecture and Design]Refactor your program so that you do not have to dynamically generate code.
- [Architecture and Design]
- [Implementation]
- [Testing]Use 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.
- [Operation]Run 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).
Related CAPEC attack patterns· 3
References
Exploits (incoming)3
| Type | Target | Confidence | Tier |
|---|---|---|---|
| AttackPattern | Manipulating User-Controlled Variablescapec-77 | 100% | live |
| AttackPattern | Leverage Executable Code in Non-Executable Filescapec-35 | 100% | live |
| AttackPattern | Code Injectioncapec-242 | 100% | live |
Compliance frameworks addressing this (incoming)3
| Type | Target | Confidence | Tier |
|---|---|---|---|
| ComplianceControl | owasp_llm_top10-llm05 | 100% | live |
| ComplianceControl | cis_v8-2 | 100% | live |
| ComplianceControl | owasp_llm_top10-llm01 | 100% | live |
(incoming)144
| Type | Target | Confidence | Tier |
|---|---|---|---|
| Vulnerability | CVE-2025-0185cve-2025-0185 | 0% | live |
| Vulnerability | CVE-2025-0530cve-2025-0530 | 0% | live |
| Vulnerability | CVE-2025-10057cve-2025-10057 | 0% | live |
| Vulnerability | CVE-2025-10097cve-2025-10097 | 0% | live |
| Vulnerability | CVE-2025-1011cve-2025-1011 | 0% | live |
| Vulnerability | CVE-2025-11344cve-2025-11344 | 0% | live |
| Vulnerability | CVE-2025-11539cve-2025-11539 | 0% | live |
| Vulnerability | CVE-2025-11837cve-2025-11837 | 0% | live |
| Vulnerability | CVE-2025-11905cve-2025-11905 | 0% | live |
| Vulnerability | CVE-2025-12637cve-2025-12637 | 0% | live |
| Vulnerability | CVE-2025-12733cve-2025-12733 | 0% | live |
| Vulnerability | CVE-2025-12735cve-2025-12735 | 0% | live |
| Vulnerability | CVE-2025-12762cve-2025-12762 | 0% | live |
| Vulnerability | CVE-2025-12813cve-2025-12813 | 0% | live |
| Vulnerability | CVE-2025-1302cve-2025-1302 | 0% | live |
| Vulnerability | CVE-2025-13035cve-2025-13035 | 0% | live |
| Vulnerability | CVE-2025-13486cve-2025-13486 | 0% | live |
| Vulnerability | CVE-2025-13773cve-2025-13773 | 0% | live |
| Vulnerability | CVE-2025-13780cve-2025-13780 | 0% | live |
| Vulnerability | CVE-2025-13786cve-2025-13786 | 0% | live |
| Vulnerability | CVE-2025-14009cve-2025-14009 | 0% | live |
| Vulnerability | CVE-2025-14287cve-2025-14287 | 0% | live |
| Vulnerability | CVE-2025-14324cve-2025-14324 | 0% | live |
| Vulnerability | CVE-2025-14856cve-2025-14856 | 0% | live |
| Vulnerability | CVE-2025-1497cve-2025-1497 | 0% | live |
| Vulnerability | CVE-2025-15024cve-2025-15024 | 0% | live |
| Vulnerability | CVE-2025-1509cve-2025-1509 | 0% | live |
| Vulnerability | CVE-2025-1510cve-2025-1510 | 0% | live |
| Vulnerability | CVE-2025-1532cve-2025-1532 | 0% | live |
| Vulnerability | CVE-2025-15393cve-2025-15393 | 0% | live |
Showing top 30 of 144 by confidence. Click any target to see the full neighbourhood.
Related by meaning· 6
Nearest entities by semantic similarity across the cs-graph corpus.