CWE-94
Allowed-with-ReviewImproper Control of Generation of Code ('Code Injection')
Abstraction: Base · Status: Draft
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.
8289 vulnerabilities reference this CWE, most recent first.
GHSA-M9RM-P9P2-3VG9
Vulnerability from github – Published: 2026-05-04 12:30 – Updated: 2026-06-06 09:31Improper Control of Generation of Code ('Code Injection') vulnerability in Profelis Information and Consulting Trade and Industry Limited Company SambaBox allows OS Command Injection.
This issue affects SambaBox: from 5.1 before 5.3.
{
"affected": [],
"aliases": [
"CVE-2026-3120"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-04T12:16:29Z",
"severity": "HIGH"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in Profelis Information and Consulting Trade and Industry Limited Company SambaBox allows OS Command Injection.\n\nThis issue affects SambaBox: from 5.1 before 5.3.",
"id": "GHSA-m9rm-p9p2-3vg9",
"modified": "2026-06-06T09:31:16Z",
"published": "2026-05-04T12:30:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-3120"
},
{
"type": "WEB",
"url": "https://siberguvenlik.gov.tr/guvenlik-bildirimleri/detay/tr-26-0155"
},
{
"type": "WEB",
"url": "https://www.usom.gov.tr/bildirim/tr-26-0155"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-M9RM-VRJQ-VH5W
Vulnerability from github – Published: 2025-11-11 18:30 – Updated: 2025-11-11 18:30NVIDIA Megatron-LM for all platforms contains a vulnerability in a script, where malicious data created by an attacker may cause a code injection issue. A successful exploit of this vulnerability may lead to code execution, escalation of privileges, information disclosure, data tampering.
{
"affected": [],
"aliases": [
"CVE-2025-23357"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-11T17:15:41Z",
"severity": "HIGH"
},
"details": "NVIDIA Megatron-LM for all platforms contains a vulnerability in a script, where malicious data created by an attacker may cause a code injection issue. A successful exploit of this vulnerability may lead to code execution, escalation of privileges, information disclosure, data tampering.",
"id": "GHSA-m9rm-vrjq-vh5w",
"modified": "2025-11-11T18:30:18Z",
"published": "2025-11-11T18:30:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-23357"
},
{
"type": "WEB",
"url": "https://nvidia.custhelp.com/app/answers/detail/a_id/5712"
},
{
"type": "WEB",
"url": "https://www.cve.org/CVERecord?id=CVE-2025-23357"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-MC23-976P-J42X
Vulnerability from github – Published: 2019-01-14 16:19 – Updated: 2022-12-18 23:44A remote code execution vulnerability exists in Xterm.js when the component mishandles special characters.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "xterm"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.8.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "xterm"
},
"ranges": [
{
"events": [
{
"introduced": "3.9.0"
},
{
"fixed": "3.9.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "xterm"
},
"ranges": [
{
"events": [
{
"introduced": "3.10.0"
},
{
"fixed": "3.10.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2019-0542"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:45:48Z",
"nvd_published_at": "2019-01-09T15:29:00Z",
"severity": "HIGH"
},
"details": "A remote code execution vulnerability exists in Xterm.js when the component mishandles special characters.",
"id": "GHSA-mc23-976p-j42x",
"modified": "2022-12-18T23:44:26Z",
"published": "2019-01-14T16:19:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-0542"
},
{
"type": "WEB",
"url": "https://github.com/xtermjs/xterm.js/commit/3592c641cd0348e0b698e8a180aea2072c6bcd9a"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHBA-2019:0959"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2019:1422"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2019:2551"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2019:2552"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-mc23-976p-j42x"
},
{
"type": "PACKAGE",
"url": "https://github.com/xtermjs/xterm.js"
},
{
"type": "WEB",
"url": "https://github.com/xtermjs/xterm.js/releases/tag/3.8.1"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/106434"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "xterm vulnerable to remote code execution "
}
GHSA-MC3J-R9QR-6VGV
Vulnerability from github – Published: 2022-03-02 00:00 – Updated: 2022-03-17 00:04Pluxml v5.8.7 was discovered to allow attackers to execute arbitrary code via crafted PHP code inserted into static pages.
{
"affected": [],
"aliases": [
"CVE-2022-25018"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-03-01T02:15:00Z",
"severity": "HIGH"
},
"details": "Pluxml v5.8.7 was discovered to allow attackers to execute arbitrary code via crafted PHP code inserted into static pages.",
"id": "GHSA-mc3j-r9qr-6vgv",
"modified": "2022-03-17T00:04:32Z",
"published": "2022-03-02T00:00:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-25018"
},
{
"type": "WEB",
"url": "https://github.com/MoritzHuppert/CVE-2022-25018/blob/main/CVE-2022-25018.pdf"
},
{
"type": "WEB",
"url": "https://github.com/pluxml/PluXml"
},
{
"type": "WEB",
"url": "https://youtu.be/Gbe2UNCB0tY"
},
{
"type": "WEB",
"url": "http://pluxml.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-MC3V-59X4-8R59
Vulnerability from github – Published: 2022-05-01 06:58 – Updated: 2022-05-01 06:58Unspecified vulnerability in Microsoft Office 2003 SP1 and SP2, Office XP SP3, Office 2000 SP3, and other products, allows user-assisted attackers to execute arbitrary code via an Office file with a malformed property that triggers memory corruption related to record lengths, aka "Microsoft Office Property Vulnerability," a different vulnerability than CVE-2006-1316.
{
"affected": [],
"aliases": [
"CVE-2006-2389"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-07-11T21:05:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in Microsoft Office 2003 SP1 and SP2, Office XP SP3, Office 2000 SP3, and other products, allows user-assisted attackers to execute arbitrary code via an Office file with a malformed property that triggers memory corruption related to record lengths, aka \"Microsoft Office Property Vulnerability,\" a different vulnerability than CVE-2006-1316.",
"id": "GHSA-mc3v-59x4-8r59",
"modified": "2022-05-01T06:58:43Z",
"published": "2022-05-01T06:58:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-2389"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2006/ms06-038"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27609"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A279"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/21012"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1016469"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/409316"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27149"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/18911"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA06-192A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/2756"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-MC47-CJ3J-GP86
Vulnerability from github – Published: 2022-05-01 18:26 – Updated: 2022-05-01 18:26PHP remote file inclusion vulnerability in environment.php in AnyInventory 1.9.1 and 2.0, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the DIR_PREFIX parameter.
{
"affected": [],
"aliases": [
"CVE-2007-4744"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-09-06T22:17:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in environment.php in AnyInventory 1.9.1 and 2.0, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the DIR_PREFIX parameter.",
"id": "GHSA-mc47-cj3j-gp86",
"modified": "2022-05-01T18:26:35Z",
"published": "2022-05-01T18:26:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4744"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36436"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4365"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26696"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/36846"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25550"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-MC64-V3MW-VQ6W
Vulnerability from github – Published: 2022-05-14 02:18 – Updated: 2022-05-14 02:18Adobe Reader and Acrobat 9.x before 9.4, and 8.x before 8.2.5 on Windows and Mac OS X, allow attackers to execute arbitrary code via unspecified vectors, related to a "prefix protocol handler vulnerability."
{
"affected": [],
"aliases": [
"CVE-2010-3625"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-10-06T17:00:00Z",
"severity": "HIGH"
},
"details": "Adobe Reader and Acrobat 9.x before 9.4, and 8.x before 8.2.5 on Windows and Mac OS X, allow attackers to execute arbitrary code via unspecified vectors, related to a \"prefix protocol handler vulnerability.\"",
"id": "GHSA-mc64-v3mw-vq6w",
"modified": "2022-05-14T02:18:01Z",
"published": "2022-05-14T02:18:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-3625"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A6772"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2010-10/msg00001.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2010-10/msg00006.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/43025"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-201101-08.xml"
},
{
"type": "WEB",
"url": "http://www.adobe.com/support/security/bulletins/apsb10-21.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2010-0743.html"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA10-279A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2011/0191"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-MC79-8XP6-RCW8
Vulnerability from github – Published: 2025-12-15 18:30 – Updated: 2025-12-16 21:30An SSTI (Server-Side Template Injection) vulnerability exists in the get_terms_and_conditions method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (terms) using frappe.render_template() with a user-supplied context (doc). Although Frappe uses a custom SandboxedEnvironment, several dangerous globals such as frappe.db.sql are still available in the execution context via get_safe_globals(). An authenticated attacker with access to create or modify a Terms and Conditions document can inject arbitrary Jinja expressions into the terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.
{
"affected": [],
"aliases": [
"CVE-2025-66436"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-918",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-15T18:15:48Z",
"severity": "MODERATE"
},
"details": "An SSTI (Server-Side Template Injection) vulnerability exists in the get_terms_and_conditions method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (terms) using frappe.render_template() with a user-supplied context (doc). Although Frappe uses a custom SandboxedEnvironment, several dangerous globals such as frappe.db.sql are still available in the execution context via get_safe_globals(). An authenticated attacker with access to create or modify a Terms and Conditions document can inject arbitrary Jinja expressions into the terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.",
"id": "GHSA-mc79-8xp6-rcw8",
"modified": "2025-12-16T21:30:52Z",
"published": "2025-12-15T18:30:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66436"
},
{
"type": "WEB",
"url": "https://iamanc.github.io/post/erpnext-ssti-bug-3"
},
{
"type": "WEB",
"url": "https://www.notion.so/SSTI-bug-3-239e6086eadc8020aeecdaf123e32f3d?source=copy_link"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-MC7R-7RQG-F4VP
Vulnerability from github – Published: 2022-05-17 05:36 – Updated: 2025-04-11 03:52PHP remote file inclusion vulnerability in nucleus/plugins/NP_gallery.php in the NP_Gallery plugin 0.94 for Nucleus allows remote attackers to execute arbitrary PHP code via a URL in the DIR_NUCLEUS parameter. NOTE: some of these details are obtained from third party information.
{
"affected": [],
"aliases": [
"CVE-2010-5040"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-11-02T21:55:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in nucleus/plugins/NP_gallery.php in the NP_Gallery plugin 0.94 for Nucleus allows remote attackers to execute arbitrary PHP code via a URL in the DIR_NUCLEUS parameter. NOTE: some of these details are obtained from third party information.",
"id": "GHSA-mc7r-7rqg-f4vp",
"modified": "2025-04-11T03:52:39Z",
"published": "2022-05-17T05:36:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-5040"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/40022"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/12787"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/65004"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/40448"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/1285"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-MC9C-24HR-W33V
Vulnerability from github – Published: 2022-05-01 23:58 – Updated: 2022-05-01 23:58PHP remote file inclusion vulnerability in config.php in Adam Scheinberg Flip 3.0 allows remote attackers to execute arbitrary PHP code via a URL in the incpath parameter.
{
"affected": [],
"aliases": [
"CVE-2008-3311"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-07-25T16:41:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in config.php in Adam Scheinberg Flip 3.0 allows remote attackers to execute arbitrary PHP code via a URL in the incpath parameter.",
"id": "GHSA-mc9c-24hr-w33v",
"modified": "2022-05-01T23:58:52Z",
"published": "2022-05-01T23:58:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-3311"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/43943"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4040"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/494585/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/30312"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation
Strategy: Refactoring
Refactor your program so that you do not have to dynamically generate code.
Mitigation
- Run 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 system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Strategy: Input Validation
- Assume 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 of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
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.
Mitigation MIT-32
Strategy: Compilation or Build Hardening
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).
Mitigation MIT-32
Strategy: Environment Hardening
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).
Mitigation
For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
CAPEC-242: Code Injection
An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.