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.
8343 vulnerabilities reference this CWE, most recent first.
GHSA-R5P3-8GVW-843F
Vulnerability from github – Published: 2024-10-08 00:31 – Updated: 2024-10-08 15:32A DLL hijacking vulnerability in VegaBird Vooki 5.2.9 allows attackers to execute arbitrary code / maintain persistence via placing a crafted DLL file in the same directory as Vooki.exe.
{
"affected": [],
"aliases": [
"CVE-2024-45874"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-07T22:15:03Z",
"severity": "CRITICAL"
},
"details": "A DLL hijacking vulnerability in VegaBird Vooki 5.2.9 allows attackers to execute arbitrary code / maintain persistence via placing a crafted DLL file in the same directory as Vooki.exe.",
"id": "GHSA-r5p3-8gvw-843f",
"modified": "2024-10-08T15:32:46Z",
"published": "2024-10-08T00:31:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-45874"
},
{
"type": "WEB",
"url": "https://sploitus.com/exploit?id=PACKETSTORM:181913"
},
{
"type": "WEB",
"url": "http://vegabird.com"
}
],
"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-R5PR-2QFG-VFR4
Vulnerability from github – Published: 2023-02-03 21:30 – Updated: 2023-02-15 18:30EMC NetWorker may potentially be vulnerable to an unauthenticated remote code execution vulnerability in the Networker Client execution service (nsrexecd) when oldauth authentication method is used. An unauthenticated remote attacker could send arbitrary commands via RPC service to be executed on the host system with the privileges of the nsrexecd service, which runs with administrative privileges.
{
"affected": [],
"aliases": [
"CVE-2023-24576"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-02-03T19:15:00Z",
"severity": "CRITICAL"
},
"details": "EMC NetWorker may potentially be vulnerable to an unauthenticated remote code execution vulnerability in the Networker Client execution service (nsrexecd) when oldauth authentication method is used. An unauthenticated remote attacker could send arbitrary commands via RPC service to be executed on the host system with the privileges of the nsrexecd service, which runs with administrative privileges.",
"id": "GHSA-r5pr-2qfg-vfr4",
"modified": "2023-02-15T18:30:21Z",
"published": "2023-02-03T21:30:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-24576"
},
{
"type": "WEB",
"url": "https://www.dell.com/support/kbdoc/en-us/000208258/dsa-2023-041-dell-networker-security-update-for-nsrdump-vulnerability"
}
],
"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-R5QJ-CVF9-P85H
Vulnerability from github – Published: 2022-03-06 00:00 – Updated: 2024-10-25 20:49PyTorch Lightning version 1.5.10 and prior is vulnerable to code injection. An attacker could execute commands on the target OS running the operating system by setting the PL_TRAINER_GPUS when using the Trainer module. A patch is included in the 1.6.0 release.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "pytorch-lightning"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.6.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-0845"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-03-07T19:58:34Z",
"nvd_published_at": "2022-03-05T22:15:00Z",
"severity": "CRITICAL"
},
"details": "PyTorch Lightning version 1.5.10 and prior is vulnerable to code injection. An attacker could execute commands on the target OS running the operating system by setting the `PL_TRAINER_GPUS` when using the `Trainer` module. A [patch](https://github.com/pytorchlightning/pytorch-lightning/commit/8b7a12c52e52a06408e9231647839ddb4665e8ae) is included in the `1.6.0` release.",
"id": "GHSA-r5qj-cvf9-p85h",
"modified": "2024-10-25T20:49:59Z",
"published": "2022-03-06T00:00:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-0845"
},
{
"type": "WEB",
"url": "https://github.com/PyTorchLightning/pytorch-lightning/pull/12212"
},
{
"type": "WEB",
"url": "https://github.com/pytorchlightning/pytorch-lightning/commit/8b7a12c52e52a06408e9231647839ddb4665e8ae"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-r5qj-cvf9-p85h"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2022-181.yaml"
},
{
"type": "WEB",
"url": "https://github.com/pytorchlightning/pytorch-lightning"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/a795bf93-c91e-4c79-aae8-f7d8bda92e2a"
}
],
"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"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Code Injection in PyTorch Lightning"
}
GHSA-R5VM-6RGR-WR28
Vulnerability from github – Published: 2022-05-02 03:21 – Updated: 2022-05-02 03:21PHP remote file inclusion vulnerability in linkadmin.php in Beerwin PHPLinkAdmin 1.0 allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.
{
"affected": [],
"aliases": [
"CVE-2009-1025"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-03-20T00:30:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in linkadmin.php in Beerwin PHPLinkAdmin 1.0 allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.",
"id": "GHSA-r5vm-6rgr-wr28",
"modified": "2022-05-02T03:21:01Z",
"published": "2022-05-02T03:21:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-1025"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/49265"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/8216"
},
{
"type": "WEB",
"url": "http://osvdb.org/52779"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34323"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/34129"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/0733"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-R5XM-PJJM-47RM
Vulnerability from github – Published: 2022-05-24 16:54 – Updated: 2024-04-04 01:46osCommerce 2.3.4.1 has an incomplete '.htaccess' for blacklist filtering in the "product" page. Remote authenticated administrators can upload new '.htaccess' files (e.g., omitting .php) and subsequently achieve arbitrary PHP code execution via a /catalog/admin/categories.php?cPath=&action=new_product URI.
{
"affected": [],
"aliases": [
"CVE-2018-18573"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-08-22T15:15:00Z",
"severity": "HIGH"
},
"details": "osCommerce 2.3.4.1 has an incomplete \u0027.htaccess\u0027 for blacklist filtering in the \"product\" page. Remote authenticated administrators can upload new \u0027.htaccess\u0027 files (e.g., omitting .php) and subsequently achieve arbitrary PHP code execution via a /catalog/admin/categories.php?cPath=\u0026action=new_product URI.",
"id": "GHSA-r5xm-pjjm-47rm",
"modified": "2024-04-04T01:46:05Z",
"published": "2022-05-24T16:54:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-18573"
},
{
"type": "WEB",
"url": "https://github.com/osCommerce/oscommerce2/issues/631"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-R64Q-RCP8-3M38
Vulnerability from github – Published: 2023-10-29 09:30 – Updated: 2023-11-08 15:30When malicious images are pulled by isula pull, attackers can execute arbitrary code.
{
"affected": [],
"aliases": [
"CVE-2021-33635"
],
"database_specific": {
"cwe_ids": [
"CWE-665",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-10-29T08:15:20Z",
"severity": "HIGH"
},
"details": "When malicious images are pulled by isula pull, attackers can execute arbitrary code.",
"id": "GHSA-r64q-rcp8-3m38",
"modified": "2023-11-08T15:30:32Z",
"published": "2023-10-29T09:30:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-33635"
},
{
"type": "WEB",
"url": "https://gitee.com/src-openeuler/iSulad/pulls/600/files"
},
{
"type": "WEB",
"url": "https://gitee.com/src-openeuler/iSulad/pulls/627/files"
},
{
"type": "WEB",
"url": "https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2023-1686"
}
],
"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-R699-WGCM-V7QP
Vulnerability from github – Published: 2022-05-14 02:32 – Updated: 2022-05-14 02:32Microsoft Forefront Protection 2010 for Exchange Server does not properly parse e-mail content, which might allow remote attackers to execute arbitrary code via a crafted message, aka "RCE Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2014-0294"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-02-12T04:50:00Z",
"severity": "HIGH"
},
"details": "Microsoft Forefront Protection 2010 for Exchange Server does not properly parse e-mail content, which might allow remote attackers to execute arbitrary code via a crafted message, aka \"RCE Vulnerability.\"",
"id": "GHSA-r699-wgcm-v7qp",
"modified": "2022-05-14T02:32:49Z",
"published": "2022-05-14T02:32:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-0294"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2014/ms14-008"
},
{
"type": "WEB",
"url": "http://osvdb.org/103161"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/56788"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/65397"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id/1029744"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-R6CW-356H-MVWG
Vulnerability from github – Published: 2023-02-12 15:30 – Updated: 2025-03-21 21:48Code Injection in GitHub repository thorsten/phpmyfaq prior to 3.1.11.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "thorsten/phpmyfaq"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.11"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-0788"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-02-14T01:03:33Z",
"nvd_published_at": "2023-02-12T14:15:00Z",
"severity": "CRITICAL"
},
"details": "Code Injection in GitHub repository thorsten/phpmyfaq prior to 3.1.11.",
"id": "GHSA-r6cw-356h-mvwg",
"modified": "2025-03-21T21:48:43Z",
"published": "2023-02-12T15:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-0788"
},
{
"type": "WEB",
"url": "https://github.com/thorsten/phpmyfaq/commit/77b42b9d0be3990ee7389207a71528b304b03039"
},
{
"type": "PACKAGE",
"url": "https://github.com/thorsten/phpMyFAQ"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/808d5452-607c-4af1-812f-26c49faf3e61"
}
],
"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 thorsten/phpmyfaq"
}
GHSA-R6F8-VRM4-59CH
Vulnerability from github – Published: 2022-05-17 04:31 – Updated: 2025-04-12 12:39The file comment feature in Rejetto HTTP File Server (hfs) 2.3c and earlier allows remote attackers to execute arbitrary code by uploading a file with certain invalid UTF-8 byte sequences that are interpreted as executable macro symbols.
{
"affected": [],
"aliases": [
"CVE-2014-7226"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-10-10T01:55:00Z",
"severity": "HIGH"
},
"details": "The file comment feature in Rejetto HTTP File Server (hfs) 2.3c and earlier allows remote attackers to execute arbitrary code by uploading a file with certain invalid UTF-8 byte sequences that are interpreted as executable macro symbols.",
"id": "GHSA-r6f8-vrm4-59ch",
"modified": "2025-04-12T12:39:29Z",
"published": "2022-05-17T04:31:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-7226"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/128532/HTTP-File-Server-2.3a-2.3b-2.3c-Remote-Command-Execution.html"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/34852"
},
{
"type": "WEB",
"url": "http://www.rejetto.com/forum/hfs-~-http-file-server/new-version-2-3d"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/70216"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-R6FW-QM5M-PX88
Vulnerability from github – Published: 2022-05-14 01:42 – Updated: 2022-05-14 01:42imcat 4.4 allows remote attackers to execute arbitrary PHP code by using root/run/adm.php to modify the boot/bootskip.php file.
{
"affected": [],
"aliases": [
"CVE-2018-20605"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-12-30T21:29:00Z",
"severity": "CRITICAL"
},
"details": "imcat 4.4 allows remote attackers to execute arbitrary PHP code by using root/run/adm.php to modify the boot/bootskip.php file.",
"id": "GHSA-r6fw-qm5m-px88",
"modified": "2022-05-14T01:42:01Z",
"published": "2022-05-14T01:42:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-20605"
},
{
"type": "WEB",
"url": "https://github.com/AvaterXXX/CVEs/blob/master/imcat.md#getshell"
}
],
"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"
}
]
}
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.