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.
8319 vulnerabilities reference this CWE, most recent first.
GHSA-PGVX-J63M-JJGR
Vulnerability from github – Published: 2022-05-02 03:41 – Updated: 2022-05-02 03:41Unspecified vulnerability in Mozilla Firefox before 3.0.14, and 3.5.x before 3.5.3, allows remote attackers to execute arbitrary JavaScript with chrome privileges via vectors involving an object, the FeedWriter, and the BrowserFeedWriter.
{
"affected": [],
"aliases": [
"CVE-2009-3079"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-09-10T21:30:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in Mozilla Firefox before 3.0.14, and 3.5.x before 3.5.3, allows remote attackers to execute arbitrary JavaScript with chrome privileges via vectors involving an object, the FeedWriter, and the BrowserFeedWriter.",
"id": "GHSA-pgvx-j63m-jjgr",
"modified": "2022-05-02T03:41:31Z",
"published": "2022-05-02T03:41:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-3079"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=454363"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10390"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A6250"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36670"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36671"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36757"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/37098"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2009/dsa-1886"
},
{
"type": "WEB",
"url": "http://www.mozilla.org/security/announce/2009/mfsa2009-51.html"
},
{
"type": "WEB",
"url": "http://www.novell.com/linux/security/advisories/2009_48_firefox.html"
},
{
"type": "WEB",
"url": "http://www.redhat.com/support/errata/RHSA-2009-1430.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/36343"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1022873"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PGX3-7H5C-GGF2
Vulnerability from github – Published: 2022-05-02 03:35 – Updated: 2022-05-02 03:35The DS\NDSD component in Novell eDirectory 8.8 before SP5 allows remote attackers to cause a denial of service (crash) via a malformed bind LDAP packet.
{
"affected": [],
"aliases": [
"CVE-2009-2457"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-07-14T20:30:00Z",
"severity": "MODERATE"
},
"details": "The DS\\NDSD component in Novell eDirectory 8.8 before SP5 allows remote attackers to cause a denial of service (crash) via a malformed bind LDAP packet.",
"id": "GHSA-pgx3-7h5c-ggf2",
"modified": "2022-05-02T03:35:29Z",
"published": "2022-05-02T03:35:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2457"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/51706"
},
{
"type": "WEB",
"url": "http://osvdb.org/55849"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34160"
},
{
"type": "WEB",
"url": "http://www.novell.com/support/viewContent.do?externalId=3426981"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/35666"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/1883"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PGX9-6822-RWXW
Vulnerability from github – Published: 2022-05-17 01:53 – Updated: 2022-05-17 01:53Double free vulnerability in OfficeImport in Apple iOS before 5 allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via a crafted Excel spreadsheet.
{
"affected": [],
"aliases": [
"CVE-2011-3261"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-10-14T10:55:00Z",
"severity": "MODERATE"
},
"details": "Double free vulnerability in OfficeImport in Apple iOS before 5 allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via a crafted Excel spreadsheet.",
"id": "GHSA-pgx9-6822-rwxw",
"modified": "2022-05-17T01:53:48Z",
"published": "2022-05-17T01:53:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-3261"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/70557"
},
{
"type": "WEB",
"url": "http://lists.apple.com/archives/Security-announce/2011//Oct/msg00001.html"
},
{
"type": "WEB",
"url": "http://support.apple.com/kb/HT4999"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PH24-5WV6-54CW
Vulnerability from github – Published: 2024-11-08 00:30 – Updated: 2024-11-08 18:30The Inshot com.downloader.privatebrowser (aka Video Downloader - XDownloader) application through 1.3.5 for Android allows an attacker to execute arbitrary JavaScript code via the com.downloader.privatebrowser.activity.PrivateMainActivity component.
{
"affected": [],
"aliases": [
"CVE-2024-46961"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-07T22:15:20Z",
"severity": "HIGH"
},
"details": "The Inshot com.downloader.privatebrowser (aka Video Downloader - XDownloader) application through 1.3.5 for Android allows an attacker to execute arbitrary JavaScript code via the com.downloader.privatebrowser.activity.PrivateMainActivity component.",
"id": "GHSA-ph24-5wv6-54cw",
"modified": "2024-11-08T18:30:49Z",
"published": "2024-11-08T00:30:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-46961"
},
{
"type": "WEB",
"url": "https://github.com/actuator/com.downloader.privatebrowser/blob/main/CVE-2024-46961"
}
],
"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:N",
"type": "CVSS_V3"
}
]
}
GHSA-PH2P-V983-F856
Vulnerability from github – Published: 2022-05-14 00:54 – Updated: 2022-05-14 00:54A potential Remote Code Execution bug exists with the PDFInfo plugin in Apache SpamAssassin before 3.4.2.
{
"affected": [],
"aliases": [
"CVE-2018-11780"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-09-17T14:29:00Z",
"severity": "CRITICAL"
},
"details": "A potential Remote Code Execution bug exists with the PDFInfo plugin in Apache SpamAssassin before 3.4.2.",
"id": "GHSA-ph2p-v983-f856",
"modified": "2022-05-14T00:54:20Z",
"published": "2022-05-14T00:54:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-11780"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/7f6a16bc0fd0fd5e67c7fd95bd655069a2ac7d1f88e42d3c853e601c@%3Cannounce.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2018/11/msg00016.html"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/201812-07"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3811-1"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3811-3"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00002.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/105373"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PH42-W6GW-P84W
Vulnerability from github – Published: 2025-01-10 00:30 – Updated: 2025-01-10 18:31An issue was discovered in Opsview Monitor Agent 6.8. An unauthenticated remote attacker can call check_nrpe against affected targets, specifying known NRPE plugins, which in default installations are configured to accept command control characters and pass them to command-line interpreters for NRPE plugin execution. This allows the attacker to escape NRPE plugin execution and execute commands remotely on the target as NT_AUTHORITY\SYSTEM.
{
"affected": [],
"aliases": [
"CVE-2023-28354"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-09T22:15:26Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in Opsview Monitor Agent 6.8. An unauthenticated remote attacker can call check_nrpe against affected targets, specifying known NRPE plugins, which in default installations are configured to accept command control characters and pass them to command-line interpreters for NRPE plugin execution. This allows the attacker to escape NRPE plugin execution and execute commands remotely on the target as NT_AUTHORITY\\SYSTEM.",
"id": "GHSA-ph42-w6gw-p84w",
"modified": "2025-01-10T18:31:40Z",
"published": "2025-01-10T00:30:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-28354"
},
{
"type": "WEB",
"url": "https://github.com/stormfleet/CVE-2023-28354/blob/main/README.md"
}
],
"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-PH58-3QM4-JPWW
Vulnerability from github – Published: 2022-07-05 00:00 – Updated: 2022-07-14 00:00The Import any XML or CSV File to WordPress plugin before 3.6.8 accepts all zip files and automatically extracts the zip file without validating the extracted file type. Allowing high privilege users such as admin to upload an arbitrary file like PHP, leading to RCE
{
"affected": [],
"aliases": [
"CVE-2022-2268"
],
"database_specific": {
"cwe_ids": [
"CWE-1236",
"CWE-434",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-07-04T13:15:00Z",
"severity": "HIGH"
},
"details": "The Import any XML or CSV File to WordPress plugin before 3.6.8 accepts all zip files and automatically extracts the zip file without validating the extracted file type. Allowing high privilege users such as admin to upload an arbitrary file like PHP, leading to RCE",
"id": "GHSA-ph58-3qm4-jpww",
"modified": "2022-07-14T00:00:19Z",
"published": "2022-07-05T00:00:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-2268"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/578093db-a025-4148-8c4b-ec2df31743f7"
}
],
"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-PH6R-7RR4-4C2Q
Vulnerability from github – Published: 2022-05-17 04:32 – Updated: 2022-05-17 04:32Unrestricted file upload vulnerability in the N-Media file uploader plugin before 3.4 for WordPress allows remote authenticated users to execute arbitrary PHP code by leveraging Author privileges to store a file.
{
"affected": [],
"aliases": [
"CVE-2014-5324"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-09-26T10:55:00Z",
"severity": "MODERATE"
},
"details": "Unrestricted file upload vulnerability in the N-Media file uploader plugin before 3.4 for WordPress allows remote authenticated users to execute arbitrary PHP code by leveraging Author privileges to store a file.",
"id": "GHSA-ph6r-7rr4-4c2q",
"modified": "2022-05-17T04:32:46Z",
"published": "2022-05-17T04:32:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-5324"
},
{
"type": "WEB",
"url": "http://jvn.jp/en/jp/JVN87863382/index.html"
},
{
"type": "WEB",
"url": "http://jvndb.jvn.jp/jvndb/JVNDB-2014-000112"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PH6W-F82W-28W6
Vulnerability from github – Published: 2025-09-03 18:06 – Updated: 2025-09-03 18:06When Claude Code was started in a new directory, it displayed a warning asking, "Do you trust the files in this folder?". This warning did not properly document that selecting "Yes, proceed" would allow Claude Code to execute files in the folder without additional confirmation. This may not have been clear to a user so we have updated the warning to clarify this functionality.
Users on standard Claude Code auto-update will have received this fix automatically. Users performing manual updates are advised to update to the latest version.
Thank you to https://hackerone.com/avivdon for reporting this issue!
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@anthropic-ai/claude-code"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.87"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-09-03T18:06:31Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "When Claude Code was started in a new directory, it displayed a warning asking, \"Do you trust the files in this folder?\". This warning did not properly document that selecting \"Yes, proceed\" would allow Claude Code to execute files in the folder without additional confirmation. This may not have been clear to a user so we have updated the warning to clarify this functionality.\u00a0\n\nUsers on standard Claude Code auto-update will have received this fix automatically. Users performing manual updates are advised to update to the latest version.\n\nThank you to https://hackerone.com/avivdon for reporting this issue!",
"id": "GHSA-ph6w-f82w-28w6",
"modified": "2025-09-03T18:06:59Z",
"published": "2025-09-03T18:06:31Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-ph6w-f82w-28w6"
},
{
"type": "PACKAGE",
"url": "https://github.com/anthropics/claude-code"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Claude Code Vulnerable to Arbitrary Code Execution Due to Insufficient Startup Warning"
}
GHSA-PH7W-P94X-9VVW
Vulnerability from github – Published: 2022-05-24 17:02 – Updated: 2023-03-03 15:30Ruby through 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4 allows code injection if the first argument (aka the "command" argument) to Shell#[] or Shell#test in lib/shell.rb is untrusted data. An attacker can exploit this to call an arbitrary Ruby method.
{
"affected": [],
"aliases": [
"CVE-2019-16255"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-11-26T18:15:00Z",
"severity": "HIGH"
},
"details": "Ruby through 2.4.7, 2.5.x through 2.5.6, and 2.6.x through 2.6.4 allows code injection if the first argument (aka the \"command\" argument) to Shell#[] or Shell#test in lib/shell.rb is untrusted data. An attacker can exploit this to call an arbitrary Ruby method.",
"id": "GHSA-ph7w-p94x-9vvw",
"modified": "2023-03-03T15:30:24Z",
"published": "2022-05-24T17:02:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-16255"
},
{
"type": "WEB",
"url": "https://hackerone.com/reports/327512"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2019/11/msg00025.html"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2019/12/msg00009.html"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2020/08/msg00027.html"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2023/04/msg00033.html"
},
{
"type": "WEB",
"url": "https://seclists.org/bugtraq/2019/Dec/31"
},
{
"type": "WEB",
"url": "https://seclists.org/bugtraq/2019/Dec/32"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202003-06"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2019/dsa-4587"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpujan2020.html"
},
{
"type": "WEB",
"url": "https://www.ruby-lang.org/ja/news/2019/10/01/code-injection-shell-test-cve-2019-16255"
},
{
"type": "WEB",
"url": "https://www.ruby-lang.org/ja/news/2019/10/01/ruby-2-4-8-released"
},
{
"type": "WEB",
"url": "https://www.ruby-lang.org/ja/news/2019/10/01/ruby-2-5-7-released"
},
{
"type": "WEB",
"url": "https://www.ruby-lang.org/ja/news/2019/10/01/ruby-2-6-5-released"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00041.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
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.