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.
8518 vulnerabilities reference this CWE, most recent first.
GHSA-9523-2MC9-2Q3G
Vulnerability from github – Published: 2022-05-02 00:00 – Updated: 2022-05-02 00:00PHP remote file inclusion vulnerability in include/admin.php in JnSHosts PHP Hosting Directory 2.0 allows remote attackers to execute arbitrary PHP code via a URL in the rd parameter.
{
"affected": [],
"aliases": [
"CVE-2008-3455"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-08-04T19:41:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in include/admin.php in JnSHosts PHP Hosting Directory 2.0 allows remote attackers to execute arbitrary PHP code via a URL in the rd parameter.",
"id": "GHSA-9523-2mc9-2q3g",
"modified": "2022-05-02T00:00:30Z",
"published": "2022-05-02T00:00:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-3455"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/44108"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/6160"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4106"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/30428"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-955R-X9J8-7RHH
Vulnerability from github – Published: 2025-12-30 15:22 – Updated: 2025-12-30 15:24Summary
Picklescan uses _operator.methodcaller, which is a built-in python library function to execute remote pickle files.
Details
The attack payload executes in the following steps:
- First, the attacker crafts the payload by calling to _operator.methodcaller function in reduce method
- Then when after the victim after checks whether or not the pickle file is safe by using Picklescan library and the library doesn't dectect any dangerous functions, pickle.load() loads this malicious pickle file, thus lead to remote code execution.
PoC
import pickle
import pickletools
opcode2 = b'''cbuiltins
__import__
(Vos
tRp0
0c_operator
methodcaller
(Vsystem
Vecho "pwned by _operator.methodcaller"
tR(g0
tR.'''
pickletools.dis(opcode2)
pickle.loads(opcode2)
This PoC can't be easily create by pickle.dumps, so it was manually built.
Impact
Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models. Attackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded. Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects.
Report by
Pinji Chen (cpj24@mails.tsinghua.edu.cn) from NISL lab (https://netsec.ccert.edu.cn/about) at Tsinghua University, Guanheng Liu (coolwind326@gmail.com).
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "picklescan"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.34"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-502",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-30T15:22:31Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\nPicklescan uses _operator.methodcaller, which is a built-in python library function to execute remote pickle files.\n\n### Details\nThe attack payload executes in the following steps:\n\n- First, the attacker crafts the payload by calling to _operator.methodcaller function in reduce method\n- Then when after the victim after checks whether or not the pickle file is safe by using Picklescan library and the library doesn\u0027t dectect any dangerous functions, pickle.load() loads this malicious pickle file, thus lead to remote code execution.\n\n### PoC\n```\nimport pickle\nimport pickletools\nopcode2 = b\u0027\u0027\u0027cbuiltins\n__import__\n(Vos\ntRp0\n0c_operator\nmethodcaller\n(Vsystem\nVecho \"pwned by _operator.methodcaller\"\ntR(g0\ntR.\u0027\u0027\u0027\npickletools.dis(opcode2)\npickle.loads(opcode2)\n```\nThis PoC can\u0027t be easily create by pickle.dumps, so it was manually built. \n\n### Impact\nAny organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models.\nAttackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded.\nAttackers can distribute infected pickle files across ML models, APIs, or saved Python objects.\n\n### Report by\nPinji Chen (cpj24@mails.tsinghua.edu.cn) from NISL lab (https://netsec.ccert.edu.cn/about) at Tsinghua University, Guanheng Liu (coolwind326@gmail.com).",
"id": "GHSA-955r-x9j8-7rhh",
"modified": "2025-12-30T15:24:26Z",
"published": "2025-12-30T15:22:31Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-955r-x9j8-7rhh"
},
{
"type": "WEB",
"url": "https://github.com/mmaitre314/picklescan/commit/f2dea43e0c838e09ace1e62994143254b51de927"
},
{
"type": "PACKAGE",
"url": "https://github.com/mmaitre314/picklescan"
},
{
"type": "WEB",
"url": "https://github.com/mmaitre314/picklescan/releases/tag/v0.0.34"
}
],
"schema_version": "1.4.0",
"severity": [
{
"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/E:P",
"type": "CVSS_V4"
}
],
"summary": "Picklescan is vulnerable to RCE via missing detection when calling built-in python _operator.methodcaller"
}
GHSA-956R-VX5G-74HW
Vulnerability from github – Published: 2022-05-01 17:44 – Updated: 2022-05-01 17:44** DISPUTED ** Multiple PHP remote file inclusion vulnerabilities in Openads (aka phpAdsNew) 2.0.7 allow remote attackers to execute arbitrary PHP code via a URL in the (1) phpAds_geoPlugin parameter to libraries/lib-remotehost.inc, the (2) filename parameter to admin/report-index, or the (3) phpAds_config[my_footer] parameter to admin/lib-gui.inc. NOTE: the vendor has disputed this issue, stating that the relevant variables are used within function definitions.
{
"affected": [],
"aliases": [
"CVE-2007-0486"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-01-25T00:28:00Z",
"severity": "HIGH"
},
"details": "** DISPUTED ** Multiple PHP remote file inclusion vulnerabilities in Openads (aka phpAdsNew) 2.0.7 allow remote attackers to execute arbitrary PHP code via a URL in the (1) phpAds_geoPlugin parameter to libraries/lib-remotehost.inc, the (2) filename parameter to admin/report-index, or the (3) phpAds_config[my_footer] parameter to admin/lib-gui.inc. NOTE: the vendor has disputed this issue, stating that the relevant variables are used within function definitions.",
"id": "GHSA-956r-vx5g-74hw",
"modified": "2022-05-01T17:44:45Z",
"published": "2022-05-01T17:44:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-0486"
},
{
"type": "WEB",
"url": "http://osvdb.org/33573"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/2174"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/457670/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/457806/100/200/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/457991/100/200/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/22172"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-9576-C88M-MWXG
Vulnerability from github – Published: 2026-03-05 06:30 – Updated: 2026-03-05 15:30Improper Control of Generation of Code ('Code Injection') vulnerability in Crocoblock JetEngine jet-engine allows Remote Code Inclusion.This issue affects JetEngine: from n/a through <= 3.7.2.
{
"affected": [],
"aliases": [
"CVE-2026-28134"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-05T06:16:48Z",
"severity": "HIGH"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in Crocoblock JetEngine jet-engine allows Remote Code Inclusion.This issue affects JetEngine: from n/a through \u003c= 3.7.2.",
"id": "GHSA-9576-c88m-mwxg",
"modified": "2026-03-05T15:30:36Z",
"published": "2026-03-05T06:30:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-28134"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/Wordpress/Plugin/jet-engine/vulnerability/wordpress-jetengine-plugin-3-7-2-remote-code-execution-rce-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-9579-5VRC-WR3M
Vulnerability from github – Published: 2023-10-10 18:31 – Updated: 2024-04-04 08:31Microsoft Message Queuing Remote Code Execution Vulnerability
{
"affected": [],
"aliases": [
"CVE-2023-36592"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-10-10T18:15:14Z",
"severity": "HIGH"
},
"details": "Microsoft Message Queuing Remote Code Execution Vulnerability",
"id": "GHSA-9579-5vrc-wr3m",
"modified": "2024-04-04T08:31:17Z",
"published": "2023-10-10T18:31:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-36592"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-36592"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-9598-XHF2-CW82
Vulnerability from github – Published: 2022-05-01 07:14 – Updated: 2022-05-01 07:14PHP remote file inclusion vulnerability in SAPID CMS 123 rc3 allows remote attackers to execute arbitrary PHP code via a URL in the (1) root_path parameter in usr/extensions/get_infochannel.inc.php and the (2) GLOBALS["root_path"] parameter in usr/extensions/get_tree.inc.php.
{
"affected": [],
"aliases": [
"CVE-2006-4026"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-08-09T00:04:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in SAPID CMS 123 rc3 allows remote attackers to execute arbitrary PHP code via a URL in the (1) root_path parameter in usr/extensions/get_infochannel.inc.php and the (2) GLOBALS[\"root_path\"] parameter in usr/extensions/get_tree.inc.php.",
"id": "GHSA-9598-xhf2-cw82",
"modified": "2022-05-01T07:14:40Z",
"published": "2022-05-01T07:14:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-4026"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/28250"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2128"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/21410"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/1346"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1016650"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/442425/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/19383"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/3191"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-95G8-GQRV-F83G
Vulnerability from github – Published: 2024-04-11 03:35 – Updated: 2024-08-27 18:31NFS in a BSD derived codebase, as used in OpenBSD through 7.4 and FreeBSD through 14.0-RELEASE, allows remote attackers to execute arbitrary code via a bug that is unrelated to memory corruption.
{
"affected": [],
"aliases": [
"CVE-2024-29937"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-11T01:25:15Z",
"severity": "CRITICAL"
},
"details": "NFS in a BSD derived codebase, as used in OpenBSD through 7.4 and FreeBSD through 14.0-RELEASE, allows remote attackers to execute arbitrary code via a bug that is unrelated to memory corruption.",
"id": "GHSA-95g8-gqrv-f83g",
"modified": "2024-08-27T18:31:34Z",
"published": "2024-04-11T03:35:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-29937"
},
{
"type": "WEB",
"url": "https://news.ycombinator.com/item?id=39778203"
},
{
"type": "WEB",
"url": "https://t2.fi/schedule/2024"
},
{
"type": "WEB",
"url": "https://www.signedness.org/t2.fi.2024"
},
{
"type": "WEB",
"url": "https://www.youtube.com/watch?v=i_JOkHaCdzk"
}
],
"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-95P4-XMXW-7258
Vulnerability from github – Published: 2023-11-03 18:30 – Updated: 2023-11-14 15:30An issue in Best Courier Management System v.1.0 allows a remote attacker to execute arbitrary code and escalate privileges via a crafted script to the userID parameter.
{
"affected": [],
"aliases": [
"CVE-2023-46980"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-11-03T16:15:31Z",
"severity": "CRITICAL"
},
"details": "An issue in Best Courier Management System v.1.0 allows a remote attacker to execute arbitrary code and escalate privileges via a crafted script to the userID parameter.",
"id": "GHSA-95p4-xmxw-7258",
"modified": "2023-11-14T15:30:23Z",
"published": "2023-11-03T18:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46980"
},
{
"type": "WEB",
"url": "https://github.com/sajaljat/CVE-2023-46980/tree/main"
},
{
"type": "WEB",
"url": "https://youtu.be/3Mz2lSElg7Y"
}
],
"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-95QJ-39W7-8CP5
Vulnerability from github – Published: 2022-05-01 18:33 – Updated: 2022-05-01 18:33Multiple PHP remote file inclusion vulnerabilities in Michael Dempfle Joomla Flash Uploader (com_jfu or com_joomla_flash_uploader) 2.5.1 component for Joomla! allow remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter to (1) install.joomla_flash_uploader.php and (2) uninstall.joomla_flash_uploader.php.
{
"affected": [],
"aliases": [
"CVE-2007-5457"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-14T19:17:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in Michael Dempfle Joomla Flash Uploader (com_jfu or com_joomla_flash_uploader) 2.5.1 component for Joomla! allow remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter to (1) install.joomla_flash_uploader.php and (2) uninstall.joomla_flash_uploader.php.",
"id": "GHSA-95qj-39w7-8cp5",
"modified": "2022-05-01T18:33:33Z",
"published": "2022-05-01T18:33:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5457"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/37181"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/39737"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4521"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/486475/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26044"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-95VP-X967-M83G
Vulnerability from github – Published: 2022-05-14 02:01 – Updated: 2022-05-14 02:01BigTree CMS 4.2.23 allows remote authenticated users, if possessing privileges to set hooks, to execute arbitrary code via /core/admin/auto-modules/forms/process.php.
{
"affected": [],
"aliases": [
"CVE-2018-17030"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-09-14T02:29:00Z",
"severity": "HIGH"
},
"details": "BigTree CMS 4.2.23 allows remote authenticated users, if possessing privileges to set hooks, to execute arbitrary code via /core/admin/auto-modules/forms/process.php.",
"id": "GHSA-95vp-x967-m83g",
"modified": "2022-05-14T02:01:44Z",
"published": "2022-05-14T02:01:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-17030"
},
{
"type": "WEB",
"url": "https://github.com/bigtreecms/BigTree-CMS/issues/342"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:H/PR:L/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.