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.
8276 vulnerabilities reference this CWE, most recent first.
GHSA-X7RQ-J53W-9X9X
Vulnerability from github – Published: 2022-05-17 04:55 – Updated: 2025-04-11 04:17The Updater in Rackspace Openstack Windows Guest Agent for XenServer before 1.2.6.0 allows remote attackers to execute arbitrary code via a crafted serialized .NET object to TCP port 1984, which triggers the download and extraction of a ZIP file that overwrites the Agent service binary.
{
"affected": [],
"aliases": [
"CVE-2013-6795"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2013-12-24T18:55:00Z",
"severity": "HIGH"
},
"details": "The Updater in Rackspace Openstack Windows Guest Agent for XenServer before 1.2.6.0 allows remote attackers to execute arbitrary code via a crafted serialized .NET object to TCP port 1984, which triggers the download and extraction of a ZIP file that overwrites the Agent service binary.",
"id": "GHSA-x7rq-j53w-9x9x",
"modified": "2025-04-11T04:17:25Z",
"published": "2022-05-17T04:55:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-6795"
},
{
"type": "WEB",
"url": "https://github.com/rackerlabs/openstack-guest-agents-windows-xenserver/commit/ef16f88f20254b8083e361f11707da25f8482401"
},
{
"type": "WEB",
"url": "https://github.com/rackerlabs/openstack-guest-agents-windows-xenserver/releases/tag/1.2.6.0"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2013-11/0122.html"
},
{
"type": "WEB",
"url": "http://blog.cloudpassage.com/2013/11/18/cve-2013-6795-vulnerability-rackspace-windows-agent-updater"
},
{
"type": "WEB",
"url": "http://osvdb.org/100191"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/124153/Rackspace-Windows-Agent-Updater-Arbitrary-Code-Execution.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/55775"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X843-G5MX-G377
Vulnerability from github – Published: 2025-12-29 20:03 – Updated: 2025-12-29 20:03Summary
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 the
operator.methodcallerfunction in methodreduce. - Then, when the victim checks whether the pickle file is safe using the Picklescan library and this library doesn't detect any dangerous functions, they decide to use pickle.load() on this malicious pickle file, thus leading to remote code execution.
PoC
import pickle
import pickletools
opcode1 = b'''cbuiltins
__import__
(Vos
tRp0
0coperator
methodcaller
(Vsystem
Vecho "pwned by operator.methodcaller"
tR(g0
tR.'''
pickletools.dis(opcode1)
pickle.loads(opcode1)
This PoC can't be easily created by pickle.dumps, therefore 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 the 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.33"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-502",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-29T20:03:30Z",
"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 the `operator.methodcaller` function in method `reduce`.\n- Then, when the victim checks whether the pickle file is safe using the Picklescan library and this library doesn\u0027t detect any dangerous functions, they decide to use pickle.load() on this malicious pickle file, thus leading to remote code execution.\n\n### PoC\n```\nimport pickle\nimport pickletools\nopcode1 = b\u0027\u0027\u0027cbuiltins\n__import__\n(Vos\ntRp0\n0coperator\nmethodcaller\n(Vsystem\nVecho \"pwned by operator.methodcaller\"\ntR(g0\ntR.\u0027\u0027\u0027\npickletools.dis(opcode1)\npickle.loads(opcode1)\n```\nThis PoC can\u0027t be easily created by pickle.dumps, therefore 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 the NISL lab (https://netsec.ccert.edu.cn/about) at Tsinghua University, Guanheng Liu (coolwind326@gmail.com).",
"id": "GHSA-x843-g5mx-g377",
"modified": "2025-12-29T20:03:30Z",
"published": "2025-12-29T20:03:30Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/mmaitre314/picklescan/security/advisories/GHSA-x843-g5mx-g377"
},
{
"type": "WEB",
"url": "https://github.com/mmaitre314/picklescan/pull/53"
},
{
"type": "WEB",
"url": "https://github.com/mmaitre314/picklescan/commit/70c1c6c31beb6baaf52c8db1b6c3c0e84a6f9dab"
},
{
"type": "PACKAGE",
"url": "https://github.com/mmaitre314/picklescan"
}
],
"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/E:P",
"type": "CVSS_V4"
}
],
"summary": "Picklescan is vulnerable to RCE through missing detection when calling built-in python operator.methodcaller"
}
GHSA-X858-RX52-6QVM
Vulnerability from github – Published: 2022-05-14 04:04 – Updated: 2022-05-14 04:04IBM Infosphere BigInsights 4.2.0 could allow an attacker to inject code that could allow access to restricted data and files. IBM X-Force ID: 126244.
{
"affected": [],
"aliases": [
"CVE-2017-1336"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-12-07T15:29:00Z",
"severity": "MODERATE"
},
"details": "IBM Infosphere BigInsights 4.2.0 could allow an attacker to inject code that could allow access to restricted data and files. IBM X-Force ID: 126244.",
"id": "GHSA-x858-rx52-6qvm",
"modified": "2022-05-14T04:04:09Z",
"published": "2022-05-14T04:04:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-1336"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/126244"
},
{
"type": "WEB",
"url": "http://www.ibm.com/support/docview.wss?uid=swg22010812"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/102061"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-X85Q-CH42-GG6W
Vulnerability from github – Published: 2022-05-17 05:49 – Updated: 2022-05-17 05:49The IICAClient interface in the ICAClient library in the ICA Client ActiveX Object (aka ICO) component in Citrix Online Plug-in for Windows for XenApp & XenDesktop before 12.0.3 allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted HTML document that triggers the reading of a .ICA file.
{
"affected": [],
"aliases": [
"CVE-2010-2991"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-08-11T20:00:00Z",
"severity": "HIGH"
},
"details": "The IICAClient interface in the ICAClient library in the ICA Client ActiveX Object (aka ICO) component in Citrix Online Plug-in for Windows for XenApp \u0026 XenDesktop before 12.0.3 allows remote attackers to execute arbitrary code or cause a denial of service (memory corruption) via a crafted HTML document that triggers the reading of a .ICA file.",
"id": "GHSA-x85q-ch42-gg6w",
"modified": "2022-05-17T05:49:02Z",
"published": "2022-05-17T05:49:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-2991"
},
{
"type": "WEB",
"url": "http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=875"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/40819"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/40821"
},
{
"type": "WEB",
"url": "http://support.citrix.com/article/CTX125976"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X863-Q7HX-5HMW
Vulnerability from github – Published: 2025-06-13 15:30 – Updated: 2025-06-17 21:32A remote code execution (RCE) vulnerability in the Plugin Management component of OpenC3 COSMOS v6.0.0 allows attackers to execute arbitrary code via uploading a crafted .txt file.
{
"affected": [],
"aliases": [
"CVE-2025-28386"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-06-13T14:15:20Z",
"severity": "CRITICAL"
},
"details": "A remote code execution (RCE) vulnerability in the Plugin Management component of OpenC3 COSMOS v6.0.0 allows attackers to execute arbitrary code via uploading a crafted .txt file.",
"id": "GHSA-x863-q7hx-5hmw",
"modified": "2025-06-17T21:32:09Z",
"published": "2025-06-13T15:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-28386"
},
{
"type": "WEB",
"url": "https://openc3.com"
},
{
"type": "WEB",
"url": "https://visionspace.com/openc3-cosmos-a-security-assessment-of-an-open-source-mission-framework"
}
],
"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-X86F-PC76-MVVW
Vulnerability from github – Published: 2022-05-01 02:20 – Updated: 2025-04-03 04:20PHP remote file inclusion vulnerability in pollvote.php in PollVote allows remote attackers to include arbitrary files via a URL in the pollname parameter.
{
"affected": [],
"aliases": [
"CVE-2005-3775"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2005-11-23T01:03:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in pollvote.php in PollVote allows remote attackers to include arbitrary files via a URL in the pollname parameter.",
"id": "GHSA-x86f-pc76-mvvw",
"modified": "2025-04-03T04:20:21Z",
"published": "2022-05-01T02:20:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2005-3775"
},
{
"type": "WEB",
"url": "http://marc.info/?l=bugtraq\u0026m=113199182125058\u0026w=2"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/17574"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/177"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/15439"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2005/2430"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X89M-RVQ3-8G32
Vulnerability from github – Published: 2024-12-15 03:30 – Updated: 2024-12-16 18:31An issue was discovered in FastNetMon Community Edition through 1.2.7. The sFlow v5 plugin allows remote attackers to cause a denial of service (application crash) via a crafted packet that specifies many sFlow samples.
{
"affected": [],
"aliases": [
"CVE-2024-56072"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-12-15T03:15:16Z",
"severity": "HIGH"
},
"details": "An issue was discovered in FastNetMon Community Edition through 1.2.7. The sFlow v5 plugin allows remote attackers to cause a denial of service (application crash) via a crafted packet that specifies many sFlow samples.",
"id": "GHSA-x89m-rvq3-8g32",
"modified": "2024-12-16T18:31:08Z",
"published": "2024-12-15T03:30:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-56072"
},
{
"type": "WEB",
"url": "https://github.com/pavel-odintsov/fastnetmon/commit/5164a29603fff9dd445b7660a35090989f005000"
},
{
"type": "WEB",
"url": "https://github.com/pavel-odintsov/fastnetmon/commit/65c40ee92dd5bcad1ab52cbafa1afd62cf669e48"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-X8CR-3JH5-WVWP
Vulnerability from github – Published: 2022-12-01 18:30 – Updated: 2022-12-05 21:30A post-auth code injection vulnerability allows admins to execute code in Webadmin of Sophos Firewall older than version 19.5 GA.
{
"affected": [],
"aliases": [
"CVE-2022-3696"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-12-01T18:15:00Z",
"severity": "HIGH"
},
"details": "A post-auth code injection vulnerability allows admins to execute code in Webadmin of Sophos Firewall older than version 19.5 GA.",
"id": "GHSA-x8cr-3jh5-wvwp",
"modified": "2022-12-05T21:30:42Z",
"published": "2022-12-01T18:30:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-3696"
},
{
"type": "WEB",
"url": "https://www.sophos.com/en-us/security-advisories/sophos-sa-20221201-sfos-19-5-0"
}
],
"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-X8G8-HQ4J-35JF
Vulnerability from github – Published: 2022-05-01 17:44 – Updated: 2022-05-01 17:44PHP remote file inclusion vulnerability in config.php in Sangwan Kim phpIndexPage 1.0.1 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the env[inc_path] parameter.
{
"affected": [],
"aliases": [
"CVE-2007-0499"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-01-25T21:28:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in config.php in Sangwan Kim phpIndexPage 1.0.1 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the env[inc_path] parameter.",
"id": "GHSA-x8g8-hq4j-35jf",
"modified": "2022-05-01T17:44:57Z",
"published": "2022-05-01T17:44:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-0499"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/3164"
},
{
"type": "WEB",
"url": "http://osvdb.org/33014"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/23992"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/22161"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/0267"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X8RW-QRMG-7CMP
Vulnerability from github – Published: 2022-12-07 21:30 – Updated: 2022-12-09 03:30AyaCMS 3.1.2 is vulnerable to Remote Code Execution (RCE).
{
"affected": [],
"aliases": [
"CVE-2022-45550"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-12-07T19:15:00Z",
"severity": "CRITICAL"
},
"details": "AyaCMS 3.1.2 is vulnerable to Remote Code Execution (RCE).",
"id": "GHSA-x8rw-qrmg-7cmp",
"modified": "2022-12-09T03:30:25Z",
"published": "2022-12-07T21:30:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-45550"
},
{
"type": "WEB",
"url": "https://github.com/loadream/AyaCMS/issues/8"
},
{
"type": "WEB",
"url": "https://shimo.im/docs/KrkEVb29pwsxZ6AJ"
}
],
"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"
}
]
}
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.