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.
8271 vulnerabilities reference this CWE, most recent first.
GHSA-G75M-CFX7-5QJP
Vulnerability from github – Published: 2022-05-01 18:35 – Updated: 2022-05-01 18:35PHP remote file inclusion vulnerability in src/scripture.php in The Online Web Library Site (TOWels) 0.1 allows remote attackers to execute arbitrary PHP code via a URL in the pageHeaderFile parameter.
{
"affected": [],
"aliases": [
"CVE-2007-5628"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-23T16:46:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in src/scripture.php in The Online Web Library Site (TOWels) 0.1 allows remote attackers to execute arbitrary PHP code via a URL in the pageHeaderFile parameter.",
"id": "GHSA-g75m-cfx7-5qjp",
"modified": "2022-05-01T18:35:21Z",
"published": "2022-05-01T18:35:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5628"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/37381"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4555"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26165"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G76P-4VG5-F4QH
Vulnerability from github – Published: 2026-05-12 18:30 – Updated: 2026-05-27 22:22The llm CLI tool thru 0.27.1 contains a critical code injection vulnerability via its --functions command-line argument. This argument is intended to allow users to provide custom Python function definitions. However, the tool directly executes the provided code using the unsafe exec() function without any sanitization, sandboxing, or security restrictions. An attacker can exploit this by crafting a malicious llm command with arbitrary Python code in the --functions argument and using social engineering to trick a victim into running it. This leads to arbitrary code execution on the victim's system, potentially granting the attacker full control.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "llm"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.27.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-31236"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-27T22:22:41Z",
"nvd_published_at": "2026-05-12T18:16:51Z",
"severity": "CRITICAL"
},
"details": "The llm CLI tool thru 0.27.1 contains a critical code injection vulnerability via its --functions command-line argument. This argument is intended to allow users to provide custom Python function definitions. However, the tool directly executes the provided code using the unsafe exec() function without any sanitization, sandboxing, or security restrictions. An attacker can exploit this by crafting a malicious llm command with arbitrary Python code in the --functions argument and using social engineering to trick a victim into running it. This leads to arbitrary code execution on the victim\u0027s system, potentially granting the attacker full control.",
"id": "GHSA-g76p-4vg5-f4qh",
"modified": "2026-05-27T22:22:41Z",
"published": "2026-05-12T18:30:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31236"
},
{
"type": "PACKAGE",
"url": "https://github.com/simonw/llm"
},
{
"type": "WEB",
"url": "https://www.notion.so/CVE-2026-31236-35d1e139318881a4a0f1fffcf671f7e3"
}
],
"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"
}
],
"summary": "llm CLI tool contains a code injection vulnerability via `--functions` command-line argument"
}
GHSA-G76V-GHPF-Q9F3
Vulnerability from github – Published: 2025-09-06 03:30 – Updated: 2025-09-06 03:30The The REHub - Price Comparison, Multi Vendor Marketplace Wordpress Theme theme for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 19.9.7. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.
{
"affected": [],
"aliases": [
"CVE-2025-7366"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-06T02:15:30Z",
"severity": "HIGH"
},
"details": "The The REHub - Price Comparison, Multi Vendor Marketplace Wordpress Theme theme for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 19.9.7. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.",
"id": "GHSA-g76v-ghpf-q9f3",
"modified": "2025-09-06T03:30:21Z",
"published": "2025-09-06T03:30:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-7366"
},
{
"type": "WEB",
"url": "https://themeforest.net/item/rehub-directory-multi-vendor-shop-coupon-affiliate-theme/7646339#item-description__19-9-8-15-augl-2025"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/4f726479-c170-4e84-a5a7-2a82d0f62ad0?source=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-G783-P3GP-4Q89
Vulnerability from github – Published: 2024-10-16 15:32 – Updated: 2026-04-01 18:32: Improper Neutralization of Special Elements Used in a Template Engine vulnerability in Unlimited Elements Unlimited Elements For Elementor (Free Widgets, Addons, Templates) allows : Command Injection.This issue affects Unlimited Elements For Elementor (Free Widgets, Addons, Templates): from n/a through 1.5.121.
{
"affected": [],
"aliases": [
"CVE-2024-49271"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-82",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-16T13:15:14Z",
"severity": "CRITICAL"
},
"details": ": Improper Neutralization of Special Elements Used in a Template Engine vulnerability in Unlimited Elements Unlimited Elements For Elementor (Free Widgets, Addons, Templates) allows : Command Injection.This issue affects Unlimited Elements For Elementor (Free Widgets, Addons, Templates): from n/a through 1.5.121.",
"id": "GHSA-g783-p3gp-4q89",
"modified": "2026-04-01T18:32:01Z",
"published": "2024-10-16T15:32:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-49271"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/unlimited-elements-for-elementor/vulnerability/wordpress-unlimited-elements-for-elementor-free-widgets-addons-templates-plugin-1-5-121-remote-code-execution-rce-vulnerability?_s_id=cve"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/unlimited-elements-for-elementor/wordpress-unlimited-elements-for-elementor-free-widgets-addons-templates-plugin-1-5-121-remote-code-execution-rce-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-G7C3-2QJ6-GRMF
Vulnerability from github – Published: 2022-05-24 19:17 – Updated: 2022-07-11 00:00Myucms v2.2.1 contains a remote code execution (RCE) vulnerability in the component \controller\point.php, which can be exploited via the add() method.
{
"affected": [],
"aliases": [
"CVE-2020-21651"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-10-06T22:15:00Z",
"severity": "CRITICAL"
},
"details": "Myucms v2.2.1 contains a remote code execution (RCE) vulnerability in the component \\controller\\point.php, which can be exploited via the add() method.",
"id": "GHSA-g7c3-2qj6-grmf",
"modified": "2022-07-11T00:00:20Z",
"published": "2022-05-24T19:17:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-21651"
},
{
"type": "WEB",
"url": "https://github.com/lolipop1234/XXD/issues/3"
},
{
"type": "WEB",
"url": "https://cwe.mitre.org/data/definitions/96.html"
}
],
"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-G7F3-F44X-7PH3
Vulnerability from github – Published: 2022-05-01 23:36 – Updated: 2025-04-09 03:53Use-after-free vulnerability in Microsoft Internet Explorer 5.01 SP4, 6 through SP1, and 7 allows remote attackers to execute arbitrary code via a crafted data stream that triggers memory corruption, as demonstrated using an invalid MIME-type that does not have a registered handler.
{
"affected": [],
"aliases": [
"CVE-2008-1085"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-04-08T23:05:00Z",
"severity": "HIGH"
},
"details": "Use-after-free vulnerability in Microsoft Internet Explorer 5.01 SP4, 6 through SP1, and 7 allows remote attackers to execute arbitrary code via a crafted data stream that triggers memory corruption, as demonstrated using an invalid MIME-type that does not have a registered handler.",
"id": "GHSA-g7f3-f44x-7ph3",
"modified": "2025-04-09T03:53:26Z",
"published": "2022-05-01T23:36:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1085"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2008/ms08-024"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A5563"
},
{
"type": "WEB",
"url": "http://marc.info/?l=bugtraq\u0026m=120845064910729\u0026w=2"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/27707"
},
{
"type": "WEB",
"url": "http://secunia.com/secunia_research/2007-100/advisory"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/490840/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28552"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1019801"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA08-099A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/1148/references"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G7FJ-5G36-4CHW
Vulnerability from github – Published: 2022-05-13 01:07 – Updated: 2022-05-13 01:07Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by accessing a deleted object, aka "Title Element Change Remote Code Execution Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2012-1877"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-06-12T22:55:00Z",
"severity": "HIGH"
},
"details": "Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by accessing a deleted object, aka \"Title Element Change Remote Code Execution Vulnerability.\"",
"id": "GHSA-g7fj-5g36-4chw",
"modified": "2022-05-13T01:07:43Z",
"published": "2022-05-13T01:07:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-1877"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2012/ms12-037"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A15472"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA12-164A.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G7GM-F84M-RXM3
Vulnerability from github – Published: 2022-05-01 07:43 – Updated: 2022-05-01 07:43PHP remote file inclusion vulnerability in addons/mod_media/body.php in Docebo 3.0.3 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the GLOBALS[where_framework] parameter. NOTE: this issue might be resultant from a global overwrite vulnerability. This issue is similar to CVE-2006-2576 and CVE-2006-3107, but the vectors are different.
{
"affected": [],
"aliases": [
"CVE-2006-6957"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-01-29T16:28:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in addons/mod_media/body.php in Docebo 3.0.3 and earlier, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the GLOBALS[where_framework] parameter. NOTE: this issue might be resultant from a global overwrite vulnerability. This issue is similar to CVE-2006-2576 and CVE-2006-3107, but the vectors are different.",
"id": "GHSA-g7gm-f84m-rxm3",
"modified": "2022-05-01T07:43:14Z",
"published": "2022-05-01T07:43:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-6957"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2006-06/0109.html"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/2194"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/26710"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-G7MQ-RFJ2-25WQ
Vulnerability from github – Published: 2021-12-10 17:26 – Updated: 2023-09-11 16:19The package total4 before 0.0.43 are vulnerable to Arbitrary Code Execution via the U.set() and U.get() functions.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "total4"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.43"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-23390"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2021-07-13T19:43:28Z",
"nvd_published_at": "2021-07-12T16:15:00Z",
"severity": "CRITICAL"
},
"details": "The package total4 before 0.0.43 are vulnerable to Arbitrary Code Execution via the `U.set()` and `U.get()` functions.",
"id": "GHSA-g7mq-rfj2-25wq",
"modified": "2023-09-11T16:19:43Z",
"published": "2021-12-10T17:26:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-23390"
},
{
"type": "WEB",
"url": "https://github.com/totaljs/framework4/commit/8a72d8c20f38bbcac031a76a51238aa528f68821"
},
{
"type": "WEB",
"url": "https://github.com/totaljs/framework4/blob/master/utils.js%23L5430-L5455"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-TOTAL4-1130527"
}
],
"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"
}
],
"summary": "Code Injection in total4"
}
GHSA-G7PH-8423-PF4J
Vulnerability from github – Published: 2024-01-22 03:30 – Updated: 2024-01-29 19:11MetaGPT through 0.6.4 allows the QaEngineer role to execute arbitrary code because RunCode.run_script() passes shell metacharacters to subprocess.Popen.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "metagpt"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.6.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-23750"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-01-22T21:20:11Z",
"nvd_published_at": "2024-01-22T01:15:08Z",
"severity": "HIGH"
},
"details": "MetaGPT through 0.6.4 allows the QaEngineer role to execute arbitrary code because RunCode.run_script() passes shell metacharacters to subprocess.Popen.",
"id": "GHSA-g7ph-8423-pf4j",
"modified": "2024-01-29T19:11:15Z",
"published": "2024-01-22T03:30:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-23750"
},
{
"type": "WEB",
"url": "https://github.com/geekan/MetaGPT/issues/731"
},
{
"type": "PACKAGE",
"url": "https://github.com/geekan/MetaGPT"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/metagpt/PYSEC-2024-9.yaml"
}
],
"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"
}
],
"summary": "Code execution in metagpt"
}
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.