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.
8358 vulnerabilities reference this CWE, most recent first.
GHSA-P86F-33VJ-VQM9
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-36591"
],
"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-p86f-33vj-vqm9",
"modified": "2024-04-04T08:31:16Z",
"published": "2023-10-10T18:31:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-36591"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-36591"
}
],
"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-P882-2J97-M4HP
Vulnerability from github – Published: 2023-07-13 03:30 – Updated: 2024-04-04 06:06acme.sh before 3.0.6 runs arbitrary commands from a remote server via eval, as exploited in the wild in June 2023.
{
"affected": [],
"aliases": [
"CVE-2023-38198"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-07-13T03:15:09Z",
"severity": "CRITICAL"
},
"details": "acme.sh before 3.0.6 runs arbitrary commands from a remote server via eval, as exploited in the wild in June 2023.",
"id": "GHSA-p882-2j97-m4hp",
"modified": "2024-04-04T06:06:23Z",
"published": "2023-07-13T03:30:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-38198"
},
{
"type": "WEB",
"url": "https://github.com/acmesh-official/acme.sh/issues/4659"
},
{
"type": "WEB",
"url": "https://github.com/acmesh-official/acme.sh/releases/tag/3.0.6"
},
{
"type": "WEB",
"url": "https://groups.google.com/a/mozilla.org/g/dev-security-policy/c/heXVr8o83Ys"
},
{
"type": "WEB",
"url": "https://news.ycombinator.com/item?id=36252310"
},
{
"type": "WEB",
"url": "https://news.ycombinator.com/item?id=36254093"
},
{
"type": "WEB",
"url": "https://www.reddit.com/r/netsec/comments/144ygg7/acmesh_runs_arbitrary_commands_from_a_remote"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2023/07/13/1"
}
],
"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-P888-PPQ3-6F8C
Vulnerability from github – Published: 2022-05-17 04:41 – Updated: 2025-04-12 12:34The av-centerd SOAP service in AlienVault OSSIM before 4.8.0 allows remote attackers to create arbitrary files and execute arbitrary code via a crafted set_file request.
{
"affected": [],
"aliases": [
"CVE-2014-4151"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-06-18T19:55:00Z",
"severity": "HIGH"
},
"details": "The av-centerd SOAP service in AlienVault OSSIM before 4.8.0 allows remote attackers to create arbitrary files and execute arbitrary code via a crafted set_file request.",
"id": "GHSA-p888-ppq3-6f8c",
"modified": "2025-04-12T12:34:57Z",
"published": "2022-05-17T04:41:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-4151"
},
{
"type": "WEB",
"url": "http://forums.alienvault.com/discussion/2806"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/59112"
},
{
"type": "WEB",
"url": "http://www.zerodayinitiative.com/advisories/ZDI-14-205"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P8F8-PJ6V-742R
Vulnerability from github – Published: 2022-05-17 02:57 – Updated: 2022-05-17 02:57Adobe Campaign versions 16.4 Build 8724 and earlier have a code injection vulnerability.
{
"affected": [],
"aliases": [
"CVE-2017-2968"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-02-15T06:59:00Z",
"severity": "CRITICAL"
},
"details": "Adobe Campaign versions 16.4 Build 8724 and earlier have a code injection vulnerability.",
"id": "GHSA-p8f8-pj6v-742r",
"modified": "2022-05-17T02:57:32Z",
"published": "2022-05-17T02:57:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-2968"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/campaign/apsb17-03.html"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/campaign/apsb17-06.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/96197"
}
],
"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:N",
"type": "CVSS_V3"
}
]
}
GHSA-P8FH-J448-7454
Vulnerability from github – Published: 2022-05-13 01:24 – Updated: 2022-05-13 01:24The TELNET service in Mobatek MobaXterm 10.4 does not require authentication, which allows remote attackers to execute arbitrary commands via TCP port 23.
{
"affected": [],
"aliases": [
"CVE-2017-15376"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-10-16T04:29:00Z",
"severity": "CRITICAL"
},
"details": "The TELNET service in Mobatek MobaXterm 10.4 does not require authentication, which allows remote attackers to execute arbitrary commands via TCP port 23.",
"id": "GHSA-p8fh-j448-7454",
"modified": "2022-05-13T01:24:57Z",
"published": "2022-05-13T01:24:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-15376"
},
{
"type": "WEB",
"url": "https://www.vulnerability-lab.com/get_content.php?id=2097"
}
],
"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-P8G8-G88F-96Q3
Vulnerability from github – Published: 2022-05-17 04:50 – Updated: 2022-05-17 04:50upgrade.py in the hp-upgrade service in HP Linux Imaging and Printing (HPLIP) 3.x through 3.13.11 launches a program from an http URL, which allows man-in-the-middle attackers to execute arbitrary code by gaining control over the client-server data stream.
{
"affected": [],
"aliases": [
"CVE-2013-6427"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2013-12-09T18:55:00Z",
"severity": "MODERATE"
},
"details": "upgrade.py in the hp-upgrade service in HP Linux Imaging and Printing (HPLIP) 3.x through 3.13.11 launches a program from an http URL, which allows man-in-the-middle attackers to execute arbitrary code by gaining control over the client-server data stream.",
"id": "GHSA-p8g8-g88f-96q3",
"modified": "2022-05-17T04:50:46Z",
"published": "2022-05-17T04:50:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-6427"
},
{
"type": "WEB",
"url": "https://bugzilla.novell.com/show_bug.cgi?id=853405"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-updates/2014-01/msg00087.html"
},
{
"type": "WEB",
"url": "http://openwall.com/lists/oss-security/2013/12/05/2"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2013/dsa-2829"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/USN-2085-1"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P8JH-8R88-35RC
Vulnerability from github – Published: 2022-05-14 02:36 – Updated: 2022-05-14 02:36ELEMENTS.DLL in Microsoft Visio 2002 SP2, 2003 SP3, and 2007 SP2 does not properly parse structures during the opening of a Visio file, which allows remote attackers to execute arbitrary code via a file containing a malformed structure, aka "Visio Data Type Memory Corruption Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2011-0093"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-02-10T16:00:00Z",
"severity": "HIGH"
},
"details": "ELEMENTS.DLL in Microsoft Visio 2002 SP2, 2003 SP3, and 2007 SP2 does not properly parse structures during the opening of a Visio file, which allows remote attackers to execute arbitrary code via a file containing a malformed structure, aka \"Visio Data Type Memory Corruption Vulnerability.\"",
"id": "GHSA-p8jh-8r88-35rc",
"modified": "2022-05-14T02:36:07Z",
"published": "2022-05-14T02:36:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-0093"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2011/ms11-008"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/64924"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A12469"
},
{
"type": "WEB",
"url": "http://osvdb.org/70829"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/43254"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/46138"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1025043"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2011/0321"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P8P9-354J-7MHR
Vulnerability from github – Published: 2022-05-24 17:30 – Updated: 2022-05-24 17:30An issue was discovered in Foxit Reader and PhantomPDF before 4.1 on macOS. Because the Hardened Runtime protection mechanism is not applied to code signing, code injection (or an information leak) can occur.
{
"affected": [],
"aliases": [
"CVE-2020-26540"
],
"database_specific": {
"cwe_ids": [
"CWE-347",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-10-02T08:15:00Z",
"severity": "HIGH"
},
"details": "An issue was discovered in Foxit Reader and PhantomPDF before 4.1 on macOS. Because the Hardened Runtime protection mechanism is not applied to code signing, code injection (or an information leak) can occur.",
"id": "GHSA-p8p9-354j-7mhr",
"modified": "2022-05-24T17:30:02Z",
"published": "2022-05-24T17:30:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-26540"
},
{
"type": "WEB",
"url": "https://www.foxitsoftware.com/support/security-bulletins.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P8Q3-H652-65VX
Vulnerability from github – Published: 2023-11-29 21:33 – Updated: 2023-12-04 15:18Impact
An authenticated backend user with the editor.cms_pages, editor.cms_layouts, or editor.cms_partials permissions who would normally not be permitted to provide PHP code to be executed by the CMS due to cms.safe_mode being enabled can write specific Twig code to escape the Twig sandbox and execute arbitrary PHP.
This is not a problem for anyone who trusts their users with those permissions to usually write and manage PHP within the CMS by not having cms.safe_mode enabled. Still, it would be a problem for anyone relying on cms.safe_mode to ensure that users with those permissions in production do not have access to write and execute arbitrary PHP.
Patches
This issue has been patched in v3.4.15.
Workarounds
As a workaround, remove the specified permissions from untrusted users.
References
Credits to: - Vasiliy Bodrov
For more information
If you have any questions or comments about this advisory: * Email us at hello@octobercms.com
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "october/system"
},
"ranges": [
{
"events": [
{
"introduced": "3.0.0"
},
{
"fixed": "3.4.15"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-44382"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-11-29T21:33:21Z",
"nvd_published_at": "2023-12-01T22:15:09Z",
"severity": "CRITICAL"
},
"details": "### Impact\n\nAn authenticated backend user with the `editor.cms_pages`, `editor.cms_layouts`, or `editor.cms_partials` permissions who would normally not be permitted to provide PHP code to be executed by the CMS due to `cms.safe_mode` being enabled can write specific Twig code to escape the Twig sandbox and execute arbitrary PHP.\n\nThis is not a problem for anyone who trusts their users with those permissions to usually write and manage PHP within the CMS by not having `cms.safe_mode` enabled. Still, it would be a problem for anyone relying on `cms.safe_mode` to ensure that users with those permissions in production do not have access to write and execute arbitrary PHP.\n\n### Patches\n\nThis issue has been patched in v3.4.15.\n\n### Workarounds\n\nAs a workaround, remove the specified permissions from untrusted users.\n\n### References\n\nCredits to:\n- [Vasiliy Bodrov](https://github.com/whatev3n)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [hello@octobercms.com](mailto:hello@octobercms.com)",
"id": "GHSA-p8q3-h652-65vx",
"modified": "2023-12-04T15:18:39Z",
"published": "2023-11-29T21:33:21Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/octobercms/october/security/advisories/GHSA-p8q3-h652-65vx"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-44382"
},
{
"type": "PACKAGE",
"url": "https://github.com/octobercms/october"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "October CMS safe mode bypass using Twig sandbox escape"
}
GHSA-P8R7-M476-V2M9
Vulnerability from github – Published: 2021-12-09 00:00 – Updated: 2021-12-10 00:00There is a Code Injection vulnerability in Huawei Smartphone.Successful exploitation of this vulnerability may lead to system restart.
{
"affected": [],
"aliases": [
"CVE-2021-37097"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-12-08T15:15:00Z",
"severity": "HIGH"
},
"details": "There is a Code Injection vulnerability in Huawei Smartphone.Successful exploitation of this vulnerability may lead to system restart.",
"id": "GHSA-p8r7-m476-v2m9",
"modified": "2021-12-10T00:00:50Z",
"published": "2021-12-09T00:00:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-37097"
},
{
"type": "WEB",
"url": "https://consumer.huawei.com/en/support/bulletin/2021/10"
},
{
"type": "WEB",
"url": "https://device.harmonyos.com/en/docs/security/update/security-bulletins-202109-0000001196270727"
}
],
"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.