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.
8384 vulnerabilities reference this CWE, most recent first.
GHSA-5X6J-MFJ4-3FC4
Vulnerability from github – Published: 2022-05-13 01:10 – Updated: 2022-05-13 01:10Eval injection vulnerability in the ldapagnt_eval function in ldapagnt.dll in unifid.exe in NetIQ Privileged User Manager 2.3.x before 2.3.1 HF2 allows remote attackers to execute arbitrary Perl code via a crafted application/x-amf request.
{
"affected": [],
"aliases": [
"CVE-2012-5932"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-12-24T18:55:00Z",
"severity": "HIGH"
},
"details": "Eval injection vulnerability in the ldapagnt_eval function in ldapagnt.dll in unifid.exe in NetIQ Privileged User Manager 2.3.x before 2.3.1 HF2 allows remote attackers to execute arbitrary Perl code via a crafted application/x-amf request.",
"id": "GHSA-5x6j-mfj4-3fc4",
"modified": "2022-05-13T01:10:50Z",
"published": "2022-05-13T01:10:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-5932"
},
{
"type": "WEB",
"url": "https://www.netiq.com/support/kb/doc.php?id=7011385"
},
{
"type": "WEB",
"url": "http://download.novell.com/Download?buildid=K6-PmbPjduA~"
},
{
"type": "WEB",
"url": "http://retrogod.altervista.org/9sg_novell_netiq_ii.htm"
},
{
"type": "WEB",
"url": "http://retrogod.altervista.org/9sg_novell_netiq_ldapagnt_adv.htm"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5X94-7MHW-9FF6
Vulnerability from github – Published: 2025-12-15 18:30 – Updated: 2025-12-16 15:30A Server-Side Template Injection (SSTI) vulnerability exists in the Frappe ERPNext through 15.89.0 Print Format rendering mechanism. Specifically, the API frappe.www.printview.get_html_and_style() triggers the rendering of the html field inside a Print Format document using frappe.render_template(template, doc) via the get_rendered_template() call chain. Although ERPNext wraps Jinja2 in a SandboxedEnvironment, it exposes sensitive functions such as frappe.db.sql through get_safe_globals(). An authenticated attacker with permission to create or modify a Print Format can inject arbitrary Jinja expressions into the html field. Once the malicious Print Format is saved, the attacker can call get_html_and_style() with a target document (e.g., Supplier or Sales Invoice) to trigger the render process. This leads to information disclosure from the database, such as database version, schema details, or sensitive values, depending on the injected payload. Exploitation flow: Create a Print Format with SSTI payload in the html field; call the get_html_and_style() API; triggers frappe.render_template(template, doc) inside get_rendered_template(); leaks database information via frappe.db.sql or other exposed globals.
{
"affected": [],
"aliases": [
"CVE-2025-66438"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-15T18:15:48Z",
"severity": "CRITICAL"
},
"details": "A Server-Side Template Injection (SSTI) vulnerability exists in the Frappe ERPNext through 15.89.0 Print Format rendering mechanism. Specifically, the API frappe.www.printview.get_html_and_style() triggers the rendering of the html field inside a Print Format document using frappe.render_template(template, doc) via the get_rendered_template() call chain. Although ERPNext wraps Jinja2 in a SandboxedEnvironment, it exposes sensitive functions such as frappe.db.sql through get_safe_globals(). An authenticated attacker with permission to create or modify a Print Format can inject arbitrary Jinja expressions into the html field. Once the malicious Print Format is saved, the attacker can call get_html_and_style() with a target document (e.g., Supplier or Sales Invoice) to trigger the render process. This leads to information disclosure from the database, such as database version, schema details, or sensitive values, depending on the injected payload. Exploitation flow: Create a Print Format with SSTI payload in the html field; call the get_html_and_style() API; triggers frappe.render_template(template, doc) inside get_rendered_template(); leaks database information via frappe.db.sql or other exposed globals.",
"id": "GHSA-5x94-7mhw-9ff6",
"modified": "2025-12-16T15:30:32Z",
"published": "2025-12-15T18:30:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66438"
},
{
"type": "WEB",
"url": "https://iamanc.github.io/post/erpnext-ssti-bug-5"
},
{
"type": "WEB",
"url": "https://www.notion.so/SSTI-bug-5-239e6086eadc80a48f17c1257a604d2c?source=copy_link"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-5XF4-H6X9-P739
Vulnerability from github – Published: 2022-05-02 03:15 – Updated: 2022-05-02 03:15PHP remote file inclusion vulnerability in includes/header.php in Groone GBook 2.0 allows remote attackers to execute arbitrary PHP code via a URL in the abspath parameter.
{
"affected": [],
"aliases": [
"CVE-2009-0464"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-02-10T07:00:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in includes/header.php in Groone GBook 2.0 allows remote attackers to execute arbitrary PHP code via a URL in the abspath parameter.",
"id": "GHSA-5xf4-h6x9-p739",
"modified": "2022-05-02T03:15:46Z",
"published": "2022-05-02T03:15:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-0464"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7955"
},
{
"type": "WEB",
"url": "http://osvdb.org/51716"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/33768"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/33578"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5XG8-Q2V8-W6F8
Vulnerability from github – Published: 2022-05-24 17:34 – Updated: 2022-05-24 17:34Arbitrary code execution vulnerability on Micro Focus ArcSight Logger product, affecting all version prior to 7.1.1. The vulnerability could be remotely exploited resulting in the execution of arbitrary code.
{
"affected": [],
"aliases": [
"CVE-2020-11851"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-11-17T02:15:00Z",
"severity": "CRITICAL"
},
"details": "Arbitrary code execution vulnerability on Micro Focus ArcSight Logger product, affecting all version prior to 7.1.1. The vulnerability could be remotely exploited resulting in the execution of arbitrary code.",
"id": "GHSA-5xg8-q2v8-w6f8",
"modified": "2022-05-24T17:34:23Z",
"published": "2022-05-24T17:34:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-11851"
},
{
"type": "WEB",
"url": "https://community.microfocus.com/t5/Logger/Logger-Release-Notes-7-1-1/ta-p/2837600"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5XGM-63RP-XWQV
Vulnerability from github – Published: 2022-05-01 07:24 – Updated: 2022-05-01 07:24PHP remote file inclusion vulnerability in admin/testing/tests/0004_init_urls.php in syntaxCMS 1.1.1 through 1.3 allows remote attackers to execute arbitrary PHP code via a URL in the init_path parameter.
{
"affected": [],
"aliases": [
"CVE-2006-5055"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-09-28T00:07:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in admin/testing/tests/0004_init_urls.php in syntaxCMS 1.1.1 through 1.3 allows remote attackers to execute arbitrary PHP code via a URL in the init_path parameter.",
"id": "GHSA-5xgm-63rp-xwqv",
"modified": "2022-05-01T07:24:33Z",
"published": "2022-05-01T07:24:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-5055"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/29122"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2424"
},
{
"type": "WEB",
"url": "http://marc.info/?l=full-disclosure\u0026m=115913461828660\u0026w=2"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1016914"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/20171"
},
{
"type": "WEB",
"url": "http://www.syntaxcms.org/content/article/detail/513"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/3760"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5XJQ-6F2F-PGRR
Vulnerability from github – Published: 2022-05-17 00:42 – Updated: 2022-05-17 00:42Multiple PHP remote file inclusion vulnerabilities in the Recly Interactive Feederator (com_feederator) component 1.0.5 for Joomla! allow remote attackers to execute arbitrary PHP code via a URL in the (1) mosConfig_absolute_path parameter to (a) add_tmsp.php, (b) edit_tmsp.php and (c) tmsp.php in includes/tmsp/; and the (2) GLOBALS[mosConfig_absolute_path] parameter to (d) includes/tmsp/subscription.php.
{
"affected": [],
"aliases": [
"CVE-2008-5789"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-12-31T11:30:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in the Recly Interactive Feederator (com_feederator) component 1.0.5 for Joomla! allow remote attackers to execute arbitrary PHP code via a URL in the (1) mosConfig_absolute_path parameter to (a) add_tmsp.php, (b) edit_tmsp.php and (c) tmsp.php in includes/tmsp/; and the (2) GLOBALS[mosConfig_absolute_path] parameter to (d) includes/tmsp/subscription.php.",
"id": "GHSA-5xjq-6f2f-pgrr",
"modified": "2022-05-17T00:42:53Z",
"published": "2022-05-17T00:42:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5789"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/46438"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7040"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4827"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32194"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5XJW-36FW-5XM4
Vulnerability from github – Published: 2022-05-01 18:45 – Updated: 2022-05-01 18:45Extended Module Player (XMP) 2.5.1 and earlier allow remote attackers to execute arbitrary code via an OXM file with a negative value, which bypasses a check in (1) test_oxm and (2) decrunch_oxm functions in misc/oxm.c, leading to a buffer overflow.
{
"affected": [],
"aliases": [
"CVE-2007-6731"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-09-13T22:30:00Z",
"severity": "HIGH"
},
"details": "Extended Module Player (XMP) 2.5.1 and earlier allow remote attackers to execute arbitrary code via an OXM file with a negative value, which bypasses a check in (1) test_oxm and (2) decrunch_oxm functions in misc/oxm.c, leading to a buffer overflow.",
"id": "GHSA-5xjw-36fw-5xm4",
"modified": "2022-05-01T18:45:56Z",
"published": "2022-05-01T18:45:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-6731"
},
{
"type": "WEB",
"url": "http://aluigi.altervista.org/adv/xmpbof-adv.txt"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27047"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0009"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5XM4-PXV6-F5VR
Vulnerability from github – Published: 2022-05-01 07:12 – Updated: 2022-05-01 07:12PHP remote file inclusion vulnerability in order/index.php in IDevSpot (1) PhpHostBot 1.0 and (2) AutoHost 3.0 allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.
{
"affected": [],
"aliases": [
"CVE-2006-3776"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-07-24T12:19:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in order/index.php in IDevSpot (1) PhpHostBot 1.0 and (2) AutoHost 3.0 allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.",
"id": "GHSA-5xm4-pxv6-f5vr",
"modified": "2022-05-01T07:12:27Z",
"published": "2022-05-01T07:12:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3776"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27852"
},
{
"type": "WEB",
"url": "http://pridels0.blogspot.com/2006/07/phphostbot-remote-file-inclusion-vuln.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/21128"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27411"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/19084"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/2899"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5XM9-RF63-WJ7H
Vulnerability from github – Published: 2022-05-17 05:18 – Updated: 2022-07-13 17:56CRLF injection vulnerability in the logout functionality in VMware SpringSource Spring Security before 2.0.7 and 3.0.x before 3.0.6 allows remote attackers to inject arbitrary HTTP headers and conduct HTTP response splitting attacks via the spring-security-redirect parameter.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.springframework.security:spring-security-core"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.springframework.security:spring-security-core"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.0.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2011-2732"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-07-13T17:56:38Z",
"nvd_published_at": "2012-12-05T17:55:00Z",
"severity": "MODERATE"
},
"details": "CRLF injection vulnerability in the logout functionality in VMware SpringSource Spring Security before 2.0.7 and 3.0.x before 3.0.6 allows remote attackers to inject arbitrary HTTP headers and conduct HTTP response splitting attacks via the spring-security-redirect parameter.",
"id": "GHSA-5xm9-rf63-wj7h",
"modified": "2022-07-13T17:56:38Z",
"published": "2022-05-17T05:18:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-2732"
},
{
"type": "PACKAGE",
"url": "https://github.com/spring-projects/spring-security"
},
{
"type": "WEB",
"url": "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677814"
},
{
"type": "WEB",
"url": "http://support.springsource.com/security/cve-2011-2732"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Improper Control of Generation of Code in Spring Security"
}
GHSA-5XRF-9RC2-JR45
Vulnerability from github – Published: 2022-05-01 18:30 – Updated: 2025-04-09 03:46Multiple PHP remote file inclusion vulnerabilities in FrontAccounting (FA) 1.13, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the path_to_root parameter to (1) access/login.php and (2) includes/lang/language.php, different vectors than CVE-2007-4279.
{
"affected": [],
"aliases": [
"CVE-2007-5117"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-09-27T17:17:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in FrontAccounting (FA) 1.13, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the path_to_root parameter to (1) access/login.php and (2) includes/lang/language.php, different vectors than CVE-2007-4279.",
"id": "GHSA-5xrf-9rc2-jr45",
"modified": "2025-04-09T03:46:39Z",
"published": "2022-05-01T18:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5117"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36796"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4456"
},
{
"type": "WEB",
"url": "http://arfis.wordpress.com/2007/09/14/rfi-02-frontaccounting"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26962"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25812"
}
],
"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.