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.
8272 vulnerabilities reference this CWE, most recent first.
GHSA-X3GH-95P8-43QV
Vulnerability from github – Published: 2022-05-14 00:56 – Updated: 2023-08-07 20:02Unrestricted file upload vulnerability in magmi/web/magmi.php in the MAGMI (aka Magento Mass Importer) plugin 0.7.17a and earlier for Magento Community Edition (CE) allows remote authenticated users to execute arbitrary code by uploading a ZIP file that contains a PHP file, then accessing the PHP file via a direct request to it in magmi/plugins/.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "dweeves/magmi"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.7.17a"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2014-8770"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-08-07T20:02:36Z",
"nvd_published_at": "2014-11-13T21:32:00Z",
"severity": "HIGH"
},
"details": "Unrestricted file upload vulnerability in `magmi/web/magmi.php` in the MAGMI (aka Magento Mass Importer) plugin 0.7.17a and earlier for Magento Community Edition (CE) allows remote authenticated users to execute arbitrary code by uploading a ZIP file that contains a PHP file, then accessing the PHP file via a direct request to it in `magmi/plugins/`.",
"id": "GHSA-x3gh-95p8-43qv",
"modified": "2023-08-07T20:02:36Z",
"published": "2022-05-14T00:56:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-8770"
},
{
"type": "WEB",
"url": "https://sourceforge.net/projects/magmi/files/magmi-0.7/plugins/packages"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/35052"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "MAGMI plugin for Magento Unsafe File Upload"
}
GHSA-X3HV-3X95-99MR
Vulnerability from github – Published: 2022-05-02 03:25 – Updated: 2022-05-02 03:25PHP remote file inclusion vulnerability in format.php in SMA-DB 0.3.12 allows remote attackers to execute arbitrary PHP code via a URL in the _page_content parameter.
{
"affected": [],
"aliases": [
"CVE-2009-1450"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-04-28T15:30:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in format.php in SMA-DB 0.3.12 allows remote attackers to execute arbitrary PHP code via a URL in the _page_content parameter.",
"id": "GHSA-x3hv-3x95-99mr",
"modified": "2022-05-02T03:25:19Z",
"published": "2022-05-02T03:25:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-1450"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7936"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X3PW-X548-2H9H
Vulnerability from github – Published: 2022-05-02 06:11 – Updated: 2022-05-02 06:11The TCP/IP implementation in Microsoft Windows Vista Gold, SP1, and SP2 and Server 2008 Gold and SP2, when IPv6 is enabled, does not properly perform bounds checking on ICMPv6 Router Advertisement packets, which allows remote attackers to execute arbitrary code via crafted packets, aka "ICMPv6 Router Advertisement Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2010-0239"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-02-10T18:30:00Z",
"severity": "HIGH"
},
"details": "The TCP/IP implementation in Microsoft Windows Vista Gold, SP1, and SP2 and Server 2008 Gold and SP2, when IPv6 is enabled, does not properly perform bounds checking on ICMPv6 Router Advertisement packets, which allows remote attackers to execute arbitrary code via crafted packets, aka \"ICMPv6 Router Advertisement Vulnerability.\"",
"id": "GHSA-x3pw-x548-2h9h",
"modified": "2022-05-02T06:11:01Z",
"published": "2022-05-02T06:11:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-0239"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-009"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A8478"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA10-040A.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X3R6-8RCC-599C
Vulnerability from github – Published: 2022-05-01 06:58 – Updated: 2022-05-01 06:58Unspecified vulnerability in Microsoft Internet Explorer 5.01 SP4 and 6 SP1 and earlier allows user-assisted remote attackers to execute arbitrary code via a crafted web page that triggers memory corruption when it is saved as a multipart HTML (.mht) file.
{
"affected": [],
"aliases": [
"CVE-2006-2385"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-06-13T19:06:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in Microsoft Internet Explorer 5.01 SP4 and 6 SP1 and earlier allows user-assisted remote attackers to execute arbitrary code via a crafted web page that triggers memory corruption when it is saved as a multipart HTML (.mht) file.",
"id": "GHSA-x3r6-8rcc-599c",
"modified": "2022-05-01T06:58:43Z",
"published": "2022-05-01T06:58:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-2385"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2006/ms06-021"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/26782"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A1167"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A1423"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A1609"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A1665"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A1911"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A1916"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/20595"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1016291"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/26446"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/18320"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/2319"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X467-HF2H-75GQ
Vulnerability from github – Published: 2024-10-26 00:32 – Updated: 2024-10-29 21:30An issue in ofcms 1.1.2 allows a remote attacker to execute arbitrary code via the FileOutputStream function in the write String method of the ofcms-admin\src\main\java\com\ofsoft\cms\core\uitle\FileUtils.java file
{
"affected": [],
"aliases": [
"CVE-2024-48236"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-25T22:15:02Z",
"severity": "MODERATE"
},
"details": "An issue in ofcms 1.1.2 allows a remote attacker to execute arbitrary code via the FileOutputStream function in the write String method of the ofcms-admin\\src\\main\\java\\com\\ofsoft\\cms\\core\\uitle\\FileUtils.java file",
"id": "GHSA-x467-hf2h-75gq",
"modified": "2024-10-29T21:30:48Z",
"published": "2024-10-26T00:32:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48236"
},
{
"type": "WEB",
"url": "https://gitee.com/oufu/ofcms/issues/IASIBT"
}
],
"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:N",
"type": "CVSS_V3"
}
]
}
GHSA-X474-4899-V7HV
Vulnerability from github – Published: 2022-05-02 03:14 – Updated: 2025-04-09 04:04Buffer overflow in a DLL file in RealNetworks RealPlayer 10, RealPlayer 10.5 6.0.12.1040 through 6.0.12.1741, RealPlayer 11 11.0.0 through 11.0.4, RealPlayer Enterprise, Mac RealPlayer 10 and 10.1, Linux RealPlayer 10, and Helix Player 10.x allows remote attackers to execute arbitrary code via a crafted Internet Video Recording (IVR) file with a filename length field containing a large integer, which triggers overwrite of an arbitrary memory location with a 0x00 byte value, related to use of RealPlayer through a Windows Explorer plugin.
{
"affected": [],
"aliases": [
"CVE-2009-0375"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-02-08T21:30:00Z",
"severity": "HIGH"
},
"details": "Buffer overflow in a DLL file in RealNetworks RealPlayer 10, RealPlayer 10.5 6.0.12.1040 through 6.0.12.1741, RealPlayer 11 11.0.0 through 11.0.4, RealPlayer Enterprise, Mac RealPlayer 10 and 10.1, Linux RealPlayer 10, and Helix Player 10.x allows remote attackers to execute arbitrary code via a crafted Internet Video Recording (IVR) file with a filename length field containing a large integer, which triggers overwrite of an arbitrary memory location with a 0x00 byte value, related to use of RealPlayer through a Windows Explorer plugin.",
"id": "GHSA-x474-4899-v7hv",
"modified": "2025-04-09T04:04:24Z",
"published": "2022-05-02T03:14:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-0375"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/48567"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/33810"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38218"
},
{
"type": "WEB",
"url": "http://service.real.com/realplayer/security/01192010_player/en"
},
{
"type": "WEB",
"url": "http://www.fortiguardcenter.com/advisory/FGA-2009-04.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/500722/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/33652"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/0178"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X485-RHG3-CQR4
Vulnerability from github – Published: 2025-08-20 18:30 – Updated: 2025-12-01 16:03Spreecommerce versions prior to 0.50.x contain a remote command execution vulnerability in the API's search functionality. Improper input sanitation allows attackers to inject arbitrary shell commands via the search[instance_eval] parameter, which is dynamically invoked using Ruby’s send method. This flaw enables unauthenticated attackers to execute commands on the server.
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "spree"
},
"ranges": [
{
"events": [
{
"introduced": "0.30.0.beta1"
},
{
"fixed": "0.50.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "RubyGems",
"name": "rd_searchlogic"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "3.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2011-10026"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-11-26T00:04:31Z",
"nvd_published_at": "2025-08-20T16:15:35Z",
"severity": "CRITICAL"
},
"details": "Spreecommerce versions prior to 0.50.x contain a remote command execution vulnerability in the API\u0027s search functionality. Improper input sanitation allows attackers to inject arbitrary shell commands via the search[instance_eval] parameter, which is dynamically invoked using Ruby\u2019s send method. This flaw enables unauthenticated attackers to execute commands on the server.",
"id": "GHSA-x485-rhg3-cqr4",
"modified": "2025-12-01T16:03:35Z",
"published": "2025-08-20T18:30:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-10026"
},
{
"type": "WEB",
"url": "https://github.com/spree/spree/commit/0a9a360c590829d8a377ceae0cf997bbbbcc2df4"
},
{
"type": "WEB",
"url": "https://github.com/spree/spree/commit/3b559e7219f3681184be409ad00cd34a34a37978"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rd_searchlogic/CVE-2011-10026.yml"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/spree/CVE-2011-10026.yml"
},
{
"type": "WEB",
"url": "https://github.com/spree"
},
{
"type": "PACKAGE",
"url": "https://github.com/spree/spree"
},
{
"type": "WEB",
"url": "https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/multi/http/spree_searchlogic_exec.rb"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20111120023342/http://spreecommerce.com/blog/2011/04/19/security-fixes"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/17199"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/spreecommerce-api-rce"
}
],
"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",
"type": "CVSS_V4"
}
],
"summary": "Spree Commerce is vulnerable to RCE through Search API"
}
GHSA-X487-866M-P8HR
Vulnerability from github – Published: 2023-05-26 15:30 – Updated: 2023-06-03 00:02Camaleon CMS prior to 2.7.4 was discovered to contain a Server-Side Template Injection (SSTI) vulnerability via the formats parameter.
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "camaleon_cms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.7.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-30145"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-05-26T19:44:38Z",
"nvd_published_at": "2023-05-26T15:15:12Z",
"severity": "CRITICAL"
},
"details": "Camaleon CMS prior to 2.7.4 was discovered to contain a Server-Side Template Injection (SSTI) vulnerability via the `formats` parameter.",
"id": "GHSA-x487-866m-p8hr",
"modified": "2023-06-03T00:02:26Z",
"published": "2023-05-26T15:30:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-30145"
},
{
"type": "WEB",
"url": "https://github.com/owen2345/camaleon-cms/issues/1052"
},
{
"type": "WEB",
"url": "https://github.com/owen2345/camaleon-cms/commit/4485788c544eb1aae52ca613bd9626129e3df6ee"
},
{
"type": "WEB",
"url": "https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection"
},
{
"type": "WEB",
"url": "https://drive.google.com/file/d/11MsSYqUnDRFjcwbQKJeL9Q8nWpgVYf2r/view?usp=share_link"
},
{
"type": "PACKAGE",
"url": "https://github.com/owen2345/camaleon-cms"
},
{
"type": "WEB",
"url": "https://github.com/owen2345/camaleon-cms/releases/tag/2.7.4"
},
{
"type": "WEB",
"url": "https://github.com/paragbagul111/CVE-2023-30145"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/camaleon_cms/CVE-2023-30145.yml"
},
{
"type": "WEB",
"url": "https://portswigger.net/research/server-side-template-injection"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/172593/Camaleon-CMS-2.7.0-Server-Side-Template-Injection.html"
}
],
"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": "Server-Side Template Injection in Camaleon CMS"
}
GHSA-X48H-JVV3-M642
Vulnerability from github – Published: 2022-05-01 06:43 – Updated: 2022-05-01 06:43PHP remote file inclusion vulnerability in common.php in Intensive Point iUser Ecommerce allows remote attackers to include arbitrary files via a URL in the include_path variable, which is not initialized before being used.
{
"affected": [],
"aliases": [
"CVE-2006-0854"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-02-23T02:06:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in common.php in Intensive Point iUser Ecommerce allows remote attackers to include arbitrary files via a URL in the include_path variable, which is not initialized before being used.",
"id": "GHSA-x48h-jvv3-m642",
"modified": "2022-05-01T06:43:18Z",
"published": "2022-05-01T06:43:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-0854"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/24724"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/fulldisclosure/2006-02/0339.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/18903"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/23429"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/16787"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/0699"
},
{
"type": "WEB",
"url": "http://www.xorcrew.net/xpa/XPA-iUser.txt"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X4F6-M5WJ-HXVG
Vulnerability from github – Published: 2022-05-01 18:30 – Updated: 2025-04-09 03:46PHP remote file inclusion vulnerability in NewsCMS/news/newstopic_inc.php in North Country Public Radio Public Media Manager (PMM) 1.3 allows remote attackers to execute arbitrary PHP code via a URL in the indir parameter.
{
"affected": [],
"aliases": [
"CVE-2007-5149"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-01T05:17:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in NewsCMS/news/newstopic_inc.php in North Country Public Radio Public Media Manager (PMM) 1.3 allows remote attackers to execute arbitrary PHP code via a URL in the indir parameter.",
"id": "GHSA-x4f6-m5wj-hxvg",
"modified": "2025-04-09T03:46:46Z",
"published": "2022-05-01T18:30:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5149"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36866"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4465"
},
{
"type": "WEB",
"url": "http://arfis.wordpress.com/2007/09/14/rfi-02-public-media-manager"
},
{
"type": "WEB",
"url": "http://osvdb.org/37399"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/27020"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/481073/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25860"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/3310"
}
],
"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.