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.
8340 vulnerabilities reference this CWE, most recent first.
GHSA-RG23-WF5C-RHRF
Vulnerability from github – Published: 2022-05-01 23:35 – Updated: 2022-05-01 23:35Apple QuickTime before 7.4.5 does not properly handle movie media tracks, which allows remote attackers to execute arbitrary code via a crafted movie that triggers memory corruption.
{
"affected": [],
"aliases": [
"CVE-2008-1016"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-04-04T17:44:00Z",
"severity": "MODERATE"
},
"details": "Apple QuickTime before 7.4.5 does not properly handle movie media tracks, which allows remote attackers to execute arbitrary code via a crafted movie that triggers memory corruption.",
"id": "GHSA-rg23-wf5c-rhrf",
"modified": "2022-05-01T23:35:55Z",
"published": "2022-05-01T23:35:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1016"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/41605"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29650"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1019760"
},
{
"type": "WEB",
"url": "http://support.apple.com/kb/HT1241"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28583"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA08-094A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/1078"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RG38-827X-4Q2G
Vulnerability from github – Published: 2022-05-17 03:57 – Updated: 2025-04-12 12:47PHP remote file inclusion vulnerability in the fetchView function in the Mage_Core_Block_Template_Zend class in Magento Community Edition (CE) 1.9.1.0 and Enterprise Edition (EE) 1.14.1.0 allows remote administrators to execute arbitrary PHP code via a URL in unspecified vectors involving the setScriptPath function. NOTE: it is not clear whether this issue crosses privilege boundaries, since administrators might already have privileges to include arbitrary files.
{
"affected": [],
"aliases": [
"CVE-2015-1399"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2015-04-29T22:59:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in the fetchView function in the Mage_Core_Block_Template_Zend class in Magento Community Edition (CE) 1.9.1.0 and Enterprise Edition (EE) 1.14.1.0 allows remote administrators to execute arbitrary PHP code via a URL in unspecified vectors involving the setScriptPath function. NOTE: it is not clear whether this issue crosses privilege boundaries, since administrators might already have privileges to include arbitrary files.",
"id": "GHSA-rg38-827x-4q2g",
"modified": "2025-04-12T12:47:37Z",
"published": "2022-05-17T03:57:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-1399"
},
{
"type": "WEB",
"url": "http://blog.checkpoint.com/2015/04/20/analyzing-magento-vulnerability"
},
{
"type": "WEB",
"url": "http://magento.com/blog/technical/critical-security-advisory-remote-code-execution-rce-vulnerability"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id/1032194"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RG3V-469F-2GXQ
Vulnerability from github – Published: 2022-05-14 03:27 – Updated: 2022-05-14 03:27sys_verifies.php in DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the refiles array parameter, because the contents of modifytmp.inc are under an attacker's control.
{
"affected": [],
"aliases": [
"CVE-2018-9174"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-04-02T03:29:00Z",
"severity": "CRITICAL"
},
"details": "sys_verifies.php in DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the refiles array parameter, because the contents of modifytmp.inc are under an attacker\u0027s control.",
"id": "GHSA-rg3v-469f-2gxq",
"modified": "2022-05-14T03:27:50Z",
"published": "2022-05-14T03:27:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-9174"
},
{
"type": "WEB",
"url": "https://xz.aliyun.com/t/2237"
}
],
"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"
}
]
}
GHSA-RG5X-2RM4-GX5F
Vulnerability from github – Published: 2022-05-14 02:35 – Updated: 2022-05-14 02:35Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by accessing a deleted object, aka "Asynchronous NULL Object Access Remote Code Execution Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2012-2521"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-08-15T01:55:00Z",
"severity": "HIGH"
},
"details": "Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by accessing a deleted object, aka \"Asynchronous NULL Object Access Remote Code Execution Vulnerability.\"",
"id": "GHSA-rg5x-2rm4-gx5f",
"modified": "2022-05-14T02:35:09Z",
"published": "2022-05-14T02:35:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-2521"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2012/ms12-052"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A15742"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA12-227A.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RG79-MPC6-WJW2
Vulnerability from github – Published: 2022-05-14 03:27 – Updated: 2022-05-14 03:27DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the egroup parameter to uploads/dede/stepselect_main.php because code within the database is accessible to uploads/dede/sys_cache_up.php.
{
"affected": [],
"aliases": [
"CVE-2018-9175"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-04-02T03:29:00Z",
"severity": "CRITICAL"
},
"details": "DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the egroup parameter to uploads/dede/stepselect_main.php because code within the database is accessible to uploads/dede/sys_cache_up.php.",
"id": "GHSA-rg79-mpc6-wjw2",
"modified": "2022-05-14T03:27:50Z",
"published": "2022-05-14T03:27:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-9175"
},
{
"type": "WEB",
"url": "https://xz.aliyun.com/t/2237"
}
],
"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"
}
]
}
GHSA-RGFF-87C8-RH44
Vulnerability from github – Published: 2022-05-14 01:27 – Updated: 2024-03-21 03:33** DISPUTED ** Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key parameter. NOTE: the vendor points out that Twig itself is not a web application and states that it is the responsibility of web applications using Twig to properly wrap input to it.
{
"affected": [],
"aliases": [
"CVE-2018-13818"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-07-10T14:29:00Z",
"severity": "CRITICAL"
},
"details": "** DISPUTED ** Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key parameter. NOTE: the vendor points out that Twig itself is not a web application and states that it is the responsibility of web applications using Twig to properly wrap input to it.",
"id": "GHSA-rgff-87c8-rh44",
"modified": "2024-03-21T03:33:31Z",
"published": "2022-05-14T01:27:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-13818"
},
{
"type": "WEB",
"url": "https://github.com/twigphp/Twig/issues/2743"
},
{
"type": "WEB",
"url": "https://github.com/twigphp/Twig/commit/eddb97148ad779f27e670e1e3f19fb323aedafeb"
},
{
"type": "WEB",
"url": "https://github.com/twigphp/Twig/blob/2.x/CHANGELOG"
},
{
"type": "WEB",
"url": "https://mobile.twitter.com/jameel_nabbo/status/1032593354704515072?s=20"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/44102"
}
],
"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"
}
]
}
GHSA-RGGC-4JRG-R8G6
Vulnerability from github – Published: 2024-03-28 21:30 – Updated: 2024-08-27 21:31The YI Smart Kami Vision com.kamivision.yismart application through 1.0.0_20231219 for Android allows a remote attacker to execute arbitrary JavaScript code via an implicit intent to the com.ants360.yicamera.activity.WebViewActivity component.
{
"affected": [],
"aliases": [
"CVE-2024-23727"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-03-28T21:16:01Z",
"severity": "HIGH"
},
"details": "The YI Smart Kami Vision com.kamivision.yismart application through 1.0.0_20231219 for Android allows a remote attacker to execute arbitrary JavaScript code via an implicit intent to the com.ants360.yicamera.activity.WebViewActivity component.",
"id": "GHSA-rggc-4jrg-r8g6",
"modified": "2024-08-27T21:31:11Z",
"published": "2024-03-28T21:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-23727"
},
{
"type": "WEB",
"url": "https://github.com/actuator/yi/blob/main/com.kamivision.yismart.V1.0.0_20231219.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-RGHC-9FHX-H32M
Vulnerability from github – Published: 2024-02-27 09:31 – Updated: 2025-02-13 19:10Malicious code injection in Apache Ambari in prior to 2.7.8. Users are recommended to upgrade to version 2.7.8, which fixes this issue.
Impact: A Cluster Operator can manipulate the request by adding a malicious code injection and gain a root over the cluster main host.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.ambari.contrib.views:ambari-contrib-views"
},
"ranges": [
{
"events": [
{
"introduced": "2.7.0"
},
{
"fixed": "2.7.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-50379"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-03-01T20:49:42Z",
"nvd_published_at": "2024-02-27T09:15:36Z",
"severity": "HIGH"
},
"details": "Malicious code injection in Apache Ambari in prior to 2.7.8.\u00a0Users are recommended to upgrade to version 2.7.8, which fixes this issue.\n\nImpact:\nA Cluster Operator can manipulate the request by adding a malicious code injection and gain a root over the cluster main host.",
"id": "GHSA-rghc-9fhx-h32m",
"modified": "2025-02-13T19:10:36Z",
"published": "2024-02-27T09:31:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-50379"
},
{
"type": "WEB",
"url": "https://github.com/apache/ambari"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/jglww6h6ngxpo1r6r5fx7ff7z29lnvv8"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2024/02/27/1"
}
],
"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"
}
],
"summary": "Apache Ambari: authenticated users could perform command injection to perform RCE"
}
GHSA-RGHV-27H7-HVXG
Vulnerability from github – Published: 2022-05-01 06:48 – Updated: 2022-05-01 06:48Microsoft Excel 2000 through 2004 allows user-assisted attackers to execute arbitrary code via a .xls file with a crafted LABEL record that triggers memory corruption.
{
"affected": [],
"aliases": [
"CVE-2006-1309"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-07-13T22:05:00Z",
"severity": "HIGH"
},
"details": "Microsoft Excel 2000 through 2004 allows user-assisted attackers to execute arbitrary code via a .xls file with a crafted LABEL record that triggers memory corruption.",
"id": "GHSA-rghv-27h7-hvxg",
"modified": "2022-05-01T06:48:04Z",
"published": "2022-05-01T06:48:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-1309"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2006/ms06-037"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A752"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1016472"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/18910"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/2755"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RGJ5-Q943-HJW8
Vulnerability from github – Published: 2022-05-17 05:40 – Updated: 2022-05-17 05:40PHP remote file inclusion vulnerability in MediaWikiParserTest.php in MediaWiki 1.16 beta, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via unspecified vectors.
{
"affected": [],
"aliases": [
"CVE-2010-2789"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2011-04-27T00:55:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in MediaWikiParserTest.php in MediaWiki 1.16 beta, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via unspecified vectors.",
"id": "GHSA-rgj5-q943-hjw8",
"modified": "2022-05-17T05:40:15Z",
"published": "2022-05-17T05:40:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-2789"
},
{
"type": "WEB",
"url": "http://lists.wikimedia.org/pipermail/mediawiki-announce/2010-July/000092.html"
},
{
"type": "WEB",
"url": "http://openwall.com/lists/oss-security/2010/07/29/4"
}
],
"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.