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.
8320 vulnerabilities reference this CWE, most recent first.
GHSA-38PV-JQ7M-MRW3
Vulnerability from github – Published: 2025-02-11 18:31 – Updated: 2025-02-11 18:31Code injection in Ivanti Connect Secure before version 22.7R2.4 and Ivanti Policy Secure before version 22.7R1.3 allows a remote authenticated attacker with admin privileges to achieve remote code execution.
{
"affected": [],
"aliases": [
"CVE-2024-10644"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-11T16:15:38Z",
"severity": "CRITICAL"
},
"details": "Code injection in Ivanti Connect Secure before version 22.7R2.4 and Ivanti Policy Secure before version 22.7R1.3 allows a remote authenticated attacker with admin privileges to achieve remote code execution.",
"id": "GHSA-38pv-jq7m-mrw3",
"modified": "2025-02-11T18:31:33Z",
"published": "2025-02-11T18:31:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-10644"
},
{
"type": "WEB",
"url": "https://forums.ivanti.com/s/article/February-Security-Advisory-Ivanti-Connect-Secure-ICS-Ivanti-Policy-Secure-IPS-and-Ivanti-Secure-Access-Client-ISAC-Multiple-CVEs"
}
],
"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-38R6-9VXJ-5MJQ
Vulnerability from github – Published: 2022-05-17 00:39 – Updated: 2022-05-17 00:39Unrestricted file upload vulnerability in admin/uploader.php in Minimal ABlog 0.4 allows remote attackers to execute arbitrary code by uploading a file with an executable extension, then accessing it via a direct request to the file in img/.
{
"affected": [],
"aliases": [
"CVE-2008-6612"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-04-06T16:30:00Z",
"severity": "MODERATE"
},
"details": "Unrestricted file upload vulnerability in admin/uploader.php in Minimal ABlog 0.4 allows remote attackers to execute arbitrary code by uploading a file with an executable extension, then accessing it via a direct request to the file in img/.",
"id": "GHSA-38r6-9vxj-5mjq",
"modified": "2022-05-17T00:39:02Z",
"published": "2022-05-17T00:39:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6612"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/46964"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7306"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32886"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32537"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/3291"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-38V6-89R5-874G
Vulnerability from github – Published: 2022-05-14 02:50 – Updated: 2022-05-14 02:50project/register.php in Tuleap before 7.7, when sys_create_project_in_one_step is disabled, allows remote authenticated users to conduct PHP object injection attacks and execute arbitrary PHP code via the data parameter.
{
"affected": [],
"aliases": [
"CVE-2014-8791"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-12-02T01:59:00Z",
"severity": "MODERATE"
},
"details": "project/register.php in Tuleap before 7.7, when sys_create_project_in_one_step is disabled, allows remote authenticated users to conduct PHP object injection attacks and execute arbitrary PHP code via the data parameter.",
"id": "GHSA-38v6-89r5-874g",
"modified": "2022-05-14T02:50:27Z",
"published": "2022-05-14T02:50:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-8791"
},
{
"type": "WEB",
"url": "http://karmainsecurity.com/KIS-2014-13"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/129309/Tuleap-7.6-4-PHP-Object-Injection.html"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2014/Nov/101"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/534105/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/71335"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-3947-V5CG-RPWJ
Vulnerability from github – Published: 2025-02-18 15:31 – Updated: 2025-02-18 15:31The Uncode Core plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 2.9.1.6. 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 authenticated attackers, with Subscriber-level access and above, to execute arbitrary shortcodes.
{
"affected": [],
"aliases": [
"CVE-2024-13689"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-18T15:15:15Z",
"severity": "MODERATE"
},
"details": "The Uncode Core plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 2.9.1.6. 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 authenticated attackers, with Subscriber-level access and above, to execute arbitrary shortcodes.",
"id": "GHSA-3947-v5cg-rpwj",
"modified": "2025-02-18T15:31:08Z",
"published": "2025-02-18T15:31:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-13689"
},
{
"type": "WEB",
"url": "https://support.undsgn.com/hc/en-us/articles/213454129-Change-Log"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/c0a61e11-1137-4da0-8580-0a44300b1542?source=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-395F-PVP5-HVP6
Vulnerability from github – Published: 2022-05-02 03:23 – Updated: 2022-05-02 03:23Static code injection vulnerability in the getConfigFile function in setup/lib/ConfigFile.class.php in phpMyAdmin 3.x before 3.1.3.2 allows remote attackers to inject arbitrary PHP code into configuration files.
{
"affected": [],
"aliases": [
"CVE-2009-1285"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-04-16T15:12:00Z",
"severity": "HIGH"
},
"details": "Static code injection vulnerability in the getConfigFile function in setup/lib/ConfigFile.class.php in phpMyAdmin 3.x before 3.1.3.2 allows remote attackers to inject arbitrary PHP code into configuration files.",
"id": "GHSA-395f-pvp5-hvp6",
"modified": "2022-05-02T03:23:39Z",
"published": "2022-05-02T03:23:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-1285"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-April/msg00442.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-April/msg00452.html"
},
{
"type": "WEB",
"url": "http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/branches/MAINT_3_1_3/phpMyAdmin/setup/lib/ConfigFile.class.php?r1=12248\u0026r2=12301\u0026pathrev=12342"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34727"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34741"
},
{
"type": "WEB",
"url": "http://www.phpmyadmin.net/home_page/security/PMASA-2009-4.php"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/34526"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/1045"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-395P-GQ7G-6X8G
Vulnerability from github – Published: 2022-06-10 00:00 – Updated: 2022-06-16 00:00Code Injection in GitHub repository jgraph/drawio prior to 19.0.2.
{
"affected": [],
"aliases": [
"CVE-2022-2014"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-06-09T17:15:00Z",
"severity": "MODERATE"
},
"details": "Code Injection in GitHub repository jgraph/drawio prior to 19.0.2.",
"id": "GHSA-395p-gq7g-6x8g",
"modified": "2022-06-16T00:00:20Z",
"published": "2022-06-10T00:00:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-2014"
},
{
"type": "WEB",
"url": "https://github.com/jgraph/drawio/commit/3d3f819d7a04da7d53b37cc0ca4269c157ba2825"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/911a4ada-7fd6-467a-a464-b88604b16ffc"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-3965-HPX2-Q597
Vulnerability from github – Published: 2024-05-24 14:45 – Updated: 2025-04-28 14:20Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted input for the name option of the compileClient, compileFileClient, or compileClientWithDependenciesTracked function. NOTE: these functions are for compiling Pug templates into JavaScript, and there would typically be no reason to allow untrusted callers.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.0.2"
},
"package": {
"ecosystem": "npm",
"name": "pug-code-gen"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.0.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.0.2"
},
"package": {
"ecosystem": "npm",
"name": "pug"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.0.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-36361"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-05-24T14:45:02Z",
"nvd_published_at": "2024-05-24T06:15:08Z",
"severity": "MODERATE"
},
"details": "Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted input for the name option of the `compileClient`, `compileFileClient`, or `compileClientWithDependenciesTracked` function. NOTE: these functions are for compiling Pug templates into JavaScript, and there would typically be no reason to allow untrusted callers.",
"id": "GHSA-3965-hpx2-q597",
"modified": "2025-04-28T14:20:50Z",
"published": "2024-05-24T14:45:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-36361"
},
{
"type": "WEB",
"url": "https://github.com/pugjs/pug/pull/3428"
},
{
"type": "WEB",
"url": "https://github.com/pugjs/pug/pull/3438"
},
{
"type": "WEB",
"url": "https://github.com/pugjs/pug/commit/32acfe8f197dc44c54e8af32c7d7b19aa9d350fb"
},
{
"type": "WEB",
"url": "https://github.com/Coding-Competition-Team/hackac-2024/tree/main/web/pug"
},
{
"type": "PACKAGE",
"url": "https://github.com/pugjs/pug"
},
{
"type": "WEB",
"url": "https://github.com/pugjs/pug/blob/4767cafea0af3d3f935553df0f9a8a6e76d470c2/packages/pug/lib/index.js#L328"
},
{
"type": "WEB",
"url": "https://github.com/pugjs/pug/releases/tag/pug%403.0.3"
},
{
"type": "WEB",
"url": "https://pugjs.org/api/reference.html"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/package/pug-code-gen"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Pug allows JavaScript code execution if an application accepts untrusted input"
}
GHSA-3969-R7GW-3F9Q
Vulnerability from github – Published: 2026-04-14 09:30 – Updated: 2026-04-14 09:30The The Germanized for WooCommerce plugin for WordPress is vulnerable to arbitrary shortcode execution via 'account_holder' parameter in all versions up to, and including, 3.20.5. 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-2026-2582"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-04-14T07:16:06Z",
"severity": "MODERATE"
},
"details": "The The Germanized for WooCommerce plugin for WordPress is vulnerable to arbitrary shortcode execution via \u0027account_holder\u0027 parameter in all versions up to, and including, 3.20.5. 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-3969-r7gw-3f9q",
"modified": "2026-04-14T09:30:44Z",
"published": "2026-04-14T09:30:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-2582"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/woocommerce-germanized/tags/3.20.5/includes/gateways/direct-debit/class-wc-gzd-gateway-direct-debit.php#L214"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/woocommerce-germanized/tags/3.20.5/includes/gateways/direct-debit/class-wc-gzd-gateway-direct-debit.php#L982"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/9e6837ad-576f-4c25-9540-6144ddc8630e?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:N",
"type": "CVSS_V3"
}
]
}
GHSA-396V-64FX-M3WV
Vulnerability from github – Published: 2022-05-14 02:39 – Updated: 2022-05-14 02:39PHP remote file inclusion vulnerability in show_joined.php in Indiscripts Enthusiast 3.1.4, and possibly earlier, allows remote attackers to execute arbitrary PHP code via a URL in the path parameter. NOTE: the researcher also points out the analogous directory traversal issue.
{
"affected": [],
"aliases": [
"CVE-2008-5792"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-12-31T11:30:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in show_joined.php in Indiscripts Enthusiast 3.1.4, and possibly earlier, allows remote attackers to execute arbitrary PHP code via a URL in the path parameter. NOTE: the researcher also points out the analogous directory traversal issue.",
"id": "GHSA-396v-64fx-m3wv",
"modified": "2022-05-14T02:39:18Z",
"published": "2022-05-14T02:39:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5792"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/46476"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7059"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32628"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4853"
},
{
"type": "WEB",
"url": "http://www.bugreport.ir/index_57.htm"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/498161/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32205"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/3073"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-397Q-WHXP-H2P3
Vulnerability from github – Published: 2022-05-17 05:20 – Updated: 2022-05-17 05:20Best Practical Solutions RT 3.6.x, 3.7.x, and 3.8.x before 3.8.12 and 4.x before 4.0.6, when the VERPPrefix and VERPDomain options are enabled, allows remote attackers to execute arbitrary code via unspecified vectors, a different vulnerability than CVE-2011-5092 and CVE-2011-5093.
{
"affected": [],
"aliases": [
"CVE-2011-4458"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-06-04T19:55:00Z",
"severity": "MODERATE"
},
"details": "Best Practical Solutions RT 3.6.x, 3.7.x, and 3.8.x before 3.8.12 and 4.x before 4.0.6, when the VERPPrefix and VERPDomain options are enabled, allows remote attackers to execute arbitrary code via unspecified vectors, a different vulnerability than CVE-2011-5092 and CVE-2011-5093.",
"id": "GHSA-397q-whxp-h2p3",
"modified": "2022-05-17T05:20:48Z",
"published": "2022-05-17T05:20:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-4458"
},
{
"type": "WEB",
"url": "http://lists.bestpractical.com/pipermail/rt-announce/2012-May/000202.html"
},
{
"type": "WEB",
"url": "http://lists.bestpractical.com/pipermail/rt-announce/2012-May/000203.html"
},
{
"type": "WEB",
"url": "http://lists.bestpractical.com/pipermail/rt-announce/2012-May/000204.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/49259"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/53660"
}
],
"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.