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.
8285 vulnerabilities reference this CWE, most recent first.
GHSA-FJ6G-9Q5Q-QVHH
Vulnerability from github – Published: 2022-05-17 03:27 – Updated: 2022-05-17 03:27PHP remote file inclusion vulnerability in ajax/myajaxphp.php in AudioShare 2.0.2 allows remote attackers to execute arbitrary PHP code via a URL in the config['basedir'] parameter.
{
"affected": [],
"aliases": [
"CVE-2015-4726"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2015-06-23T14:59:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in ajax/myajaxphp.php in AudioShare 2.0.2 allows remote attackers to execute arbitrary PHP code via a URL in the config[\u0027basedir\u0027] parameter.",
"id": "GHSA-fj6g-9q5q-qvhh",
"modified": "2022-05-17T03:27:30Z",
"published": "2022-05-17T03:27:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-4726"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/132337/Audio-Share-2.0.2-Cross-Site-Scripting-Remote-File-Inclusion.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/75382"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-FJ85-3HPV-97RG
Vulnerability from github – Published: 2024-12-06 15:31 – Updated: 2026-04-01 18:32Improper Control of Generation of Code ('Code Injection') vulnerability in WP Sharks s2Member Pro allows Code Injection.This issue affects s2Member Pro: from n/a through 241114.
{
"affected": [],
"aliases": [
"CVE-2024-51815"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-12-06T14:15:21Z",
"severity": "CRITICAL"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in WP Sharks s2Member Pro allows Code Injection.This issue affects s2Member Pro: from n/a through 241114.",
"id": "GHSA-fj85-3hpv-97rg",
"modified": "2026-04-01T18:32:40Z",
"published": "2024-12-06T15:31:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51815"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/s2member/vulnerability/wordpress-s2member-excellent-for-all-kinds-of-memberships-content-restriction-paywalls-member-access-subscriptions-plugin-241114-remote-code-execution-rce-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-FJ97-QC2X-QQM7
Vulnerability from github – Published: 2022-05-02 00:11 – Updated: 2022-05-02 00:11plugins/wacko/highlight/html.php in Strawberry in CuteNews.ru 1.1.1 (aka Strawberry) allows remote attackers to execute arbitrary PHP code via the text parameter, which is inserted into an executable regular expression.
{
"affected": [],
"aliases": [
"CVE-2008-4557"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-10-14T22:36:00Z",
"severity": "HIGH"
},
"details": "plugins/wacko/highlight/html.php in Strawberry in CuteNews.ru 1.1.1 (aka Strawberry) allows remote attackers to execute arbitrary PHP code via the text parameter, which is inserted into an executable regular expression.",
"id": "GHSA-fj97-qc2x-qqm7",
"modified": "2022-05-02T00:11:20Z",
"published": "2022-05-02T00:11:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4557"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/39450"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4851"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28330"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4403"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/40236"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-FJGJ-7XGJ-VMH7
Vulnerability from github – Published: 2023-03-16 06:30 – Updated: 2025-02-26 21:30In affected versions of Octopus Deploy it is possible for a user to introduce code via offline package creation
{
"affected": [],
"aliases": [
"CVE-2022-4009"
],
"database_specific": {
"cwe_ids": [
"CWE-77",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-03-16T04:15:00Z",
"severity": "HIGH"
},
"details": "In affected versions of Octopus Deploy it is possible for a user to introduce code via offline package creation",
"id": "GHSA-fjgj-7xgj-vmh7",
"modified": "2025-02-26T21:30:23Z",
"published": "2023-03-16T06:30:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-4009"
},
{
"type": "WEB",
"url": "https://advisories.octopus.com/post/2023/sa2023-05"
}
],
"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"
}
]
}
GHSA-FJMR-7667-8V4P
Vulnerability from github – Published: 2025-12-30 00:32 – Updated: 2025-12-31 22:05To prevent unexpected untrusted code execution, the Visual Studio Code Go extension is now disabled in Restricted Mode.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/golang/vscode-go"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.52.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-68120"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-31T22:05:05Z",
"nvd_published_at": "2025-12-30T00:15:52Z",
"severity": "MODERATE"
},
"details": "To prevent unexpected untrusted code execution, the Visual Studio Code Go extension is now disabled in Restricted Mode.",
"id": "GHSA-fjmr-7667-8v4p",
"modified": "2025-12-31T22:05:05Z",
"published": "2025-12-30T00:32:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-68120"
},
{
"type": "PACKAGE",
"url": "https://github.com/golang/vscode-go"
},
{
"type": "WEB",
"url": "https://groups.google.com/g/golang-dev/c/CHG4qfcicBU/m/4tanFUymDQAJ"
},
{
"type": "WEB",
"url": "https://pkg.go.dev/vuln/GO-2025-4249"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "Visual Studio Code Go extension has unexpected untrusted code execution"
}
GHSA-FJP3-X79G-GRGM
Vulnerability from github – Published: 2022-05-02 06:11 – Updated: 2025-04-11 03:32Microsoft Office Excel 2007 SP1 and SP2; Office 2008 for Mac; Open XML File Format Converter for Mac; Office Excel Viewer SP1 and SP2; Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats SP1 and SP2; and Office SharePoint Server 2007 SP1 and SP2 do not validate ZIP headers during decompression of Open XML (.XLSX) documents, which allows remote attackers to execute arbitrary code via a crafted document that triggers access to uninitialized memory locations, aka "Microsoft Office Excel XLSX File Parsing Code Execution Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2010-0263"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-03-10T22:30:00Z",
"severity": "HIGH"
},
"details": "Microsoft Office Excel 2007 SP1 and SP2; Office 2008 for Mac; Open XML File Format Converter for Mac; Office Excel Viewer SP1 and SP2; Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats SP1 and SP2; and Office SharePoint Server 2007 SP1 and SP2 do not validate ZIP headers during decompression of Open XML (.XLSX) documents, which allows remote attackers to execute arbitrary code via a crafted document that triggers access to uninitialized memory locations, aka \"Microsoft Office Excel XLSX File Parsing Code Execution Vulnerability.\"",
"id": "GHSA-fjp3-x79g-grgm",
"modified": "2025-04-11T03:32:13Z",
"published": "2022-05-02T06:11:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-0263"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-017"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A8407"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/509979/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1023698"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA10-068A.html"
},
{
"type": "WEB",
"url": "http://www.zerodayinitiative.com/advisories/ZDI-10-025"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-FJQQ-2PGG-5JC3
Vulnerability from github – Published: 2022-05-14 02:34 – Updated: 2022-05-14 02:34Microsoft Internet Explorer 6 through 10 allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted web site, aka "Internet Explorer Memory Corruption Vulnerability," a different vulnerability than CVE-2013-3153.
{
"affected": [],
"aliases": [
"CVE-2013-3148"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2013-07-10T03:46:00Z",
"severity": "HIGH"
},
"details": "Microsoft Internet Explorer 6 through 10 allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted web site, aka \"Internet Explorer Memory Corruption Vulnerability,\" a different vulnerability than CVE-2013-3153.",
"id": "GHSA-fjqq-2pgg-5jc3",
"modified": "2022-05-14T02:34:17Z",
"published": "2022-05-14T02:34:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-3148"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2013/ms13-055"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A17034"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/ncas/alerts/TA13-190A"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-FJX5-XM7Q-WHVJ
Vulnerability from github – Published: 2023-05-12 12:30 – Updated: 2025-01-24 20:18An issue found in CraftCMS v.3.8.1 allows a remote attacker to execute arbitrary code via a crafted script to the Section parameter.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "3.8.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-30130"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-05-12T20:14:07Z",
"nvd_published_at": "2023-05-12T11:15:13Z",
"severity": "HIGH"
},
"details": "An issue found in CraftCMS v.3.8.1 allows a remote attacker to execute arbitrary code via a crafted script to the Section parameter.",
"id": "GHSA-fjx5-xm7q-whvj",
"modified": "2025-01-24T20:18:34Z",
"published": "2023-05-12T12:30:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-30130"
},
{
"type": "WEB",
"url": "https://craftcms.com"
},
{
"type": "PACKAGE",
"url": "https://github.com/craftcms/cms"
},
{
"type": "WEB",
"url": "https://tf1t.gitbook.io/mycve/craftcms/server-site-template-injection-on-craftcms-3.8.1"
}
],
"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:H",
"type": "CVSS_V3"
}
],
"summary": "CraftCMS allows remote attacker to execute arbitrary code via crafted script to Section parameter"
}
GHSA-FM2C-GM53-7RGJ
Vulnerability from github – Published: 2022-05-01 18:33 – Updated: 2022-05-01 18:33PHP remote file inclusion vulnerability in admin.wmtrssreader.php in the webmaster-tips.net Flash RSS Reader (com_wmtrssreader) 1.0 component for Joomla! allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_live_site parameter.
{
"affected": [],
"aliases": [
"CVE-2007-5410"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-12T18:17:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in admin.wmtrssreader.php in the webmaster-tips.net Flash RSS Reader (com_wmtrssreader) 1.0 component for Joomla! allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_live_site parameter.",
"id": "GHSA-fm2c-gm53-7rgj",
"modified": "2022-05-01T18:33:08Z",
"published": "2022-05-01T18:33:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5410"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/37056"
},
{
"type": "WEB",
"url": "http://osvdb.org/43765"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3211"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/481979/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25999"
},
{
"type": "WEB",
"url": "http://www.sibersavascilar.com/merhaba-dunya-1.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-FM43-2P79-W753
Vulnerability from github – Published: 2022-05-01 23:30 – Updated: 2022-05-01 23:30Eval injection vulnerability in admin/op/disp.php in Netwerk Smart Publisher 1.0.1 allows remote attackers to execute arbitrary PHP code via the filedata parameter.
{
"affected": [],
"aliases": [
"CVE-2008-0503"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-01-31T20:00:00Z",
"severity": "MODERATE"
},
"details": "Eval injection vulnerability in admin/op/disp.php in Netwerk Smart Publisher 1.0.1 allows remote attackers to execute arbitrary PHP code via the filedata parameter.",
"id": "GHSA-fm43-2p79-w753",
"modified": "2022-05-01T23:30:55Z",
"published": "2022-05-01T23:30:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-0503"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/5003"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/28685"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27488"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0352"
}
],
"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.