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.
8562 vulnerabilities reference this CWE, most recent first.
GHSA-3J7W-H2JH-289J
Vulnerability from github – Published: 2024-05-14 21:34 – Updated: 2024-11-13 00:30Unchecked script execution in Graphic on-click binding in affected LibreOffice versions allows an attacker to create a document which without prompt will execute scripts built-into LibreOffice on clicking a graphic. Such scripts were previously deemed trusted but are now deemed untrusted.
{
"affected": [],
"aliases": [
"CVE-2024-3044"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-356",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-14T21:15:12Z",
"severity": "MODERATE"
},
"details": "Unchecked script execution in Graphic on-click binding in affected LibreOffice versions allows an attacker to create a document which without prompt will execute scripts built-into LibreOffice on clicking a graphic. Such scripts were previously deemed trusted but are now deemed untrusted.\n",
"id": "GHSA-3j7w-h2jh-289j",
"modified": "2024-11-13T00:30:47Z",
"published": "2024-05-14T21:34:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3044"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2024/05/msg00016.html"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3TU3TYDXICKPYHMCNL7ARYYBXACEAYJ4"
},
{
"type": "WEB",
"url": "https://www.libreoffice.org/about-us/security/advisories/CVE-2024-3044"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-3JC6-6R48-V6QF
Vulnerability from github – Published: 2026-04-20 03:34 – Updated: 2026-04-23 14:23A Prototype Pollution vulnerability was determined in brikcss merge up to 1.3.0. Executing a manipulation of the argument proto/constructor.prototype/prototype can lead to improperly controlled modification of object prototype attributes. The attack may be performed from remote. The vendor was contacted early about this disclosure but did not respond in any way.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@brikcss/merge"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.3.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-6594"
],
"database_specific": {
"cwe_ids": [
"CWE-1321",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-23T14:23:26Z",
"nvd_published_at": "2026-04-20T02:16:15Z",
"severity": "MODERATE"
},
"details": "A Prototype Pollution vulnerability was determined in brikcss merge up to 1.3.0. Executing a manipulation of the argument __proto__/constructor.prototype/prototype can lead to improperly controlled modification of object prototype attributes. The attack may be performed from remote. The vendor was contacted early about this disclosure but did not respond in any way.",
"id": "GHSA-3jc6-6r48-v6qf",
"modified": "2026-04-23T14:23:26Z",
"published": "2026-04-20T03:34:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-6594"
},
{
"type": "PACKAGE",
"url": "https://github.com/brikcss/merge"
},
{
"type": "WEB",
"url": "https://github.com/sudo-secure/security-research/blob/main/brikcss-merge/prototype-pollution/PoC.md"
},
{
"type": "WEB",
"url": "https://vuldb.com/submit/791805"
},
{
"type": "WEB",
"url": "https://vuldb.com/vuln/358229"
},
{
"type": "WEB",
"url": "https://vuldb.com/vuln/358229/cti"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Deep Merge is Vulnerable to Prototype Pollution Through Lack of Sanitization"
}
GHSA-3JCX-V57W-C6RQ
Vulnerability from github – Published: 2021-12-01 00:00 – Updated: 2022-08-10 00:00Vulnerability in dirhistory plugin Description: the widgets that go back and forward in the directory history, triggered by pressing Alt-Left and Alt-Right, use functions that unsafely execute eval on directory names. If you cd into a directory with a carefully-crafted name, then press Alt-Left, the system is subject to command injection. Impacted areas: - Functions pop_past and pop_future in dirhistory plugin.
{
"affected": [],
"aliases": [
"CVE-2021-3725"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-11-30T10:15:00Z",
"severity": "HIGH"
},
"details": "Vulnerability in dirhistory plugin Description: the widgets that go back and forward in the directory history, triggered by pressing Alt-Left and Alt-Right, use functions that unsafely execute eval on directory names. If you cd into a directory with a carefully-crafted name, then press Alt-Left, the system is subject to command injection. Impacted areas: - Functions pop_past and pop_future in dirhistory plugin.",
"id": "GHSA-3jcx-v57w-c6rq",
"modified": "2022-08-10T00:00:23Z",
"published": "2021-12-01T00:00:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3725"
},
{
"type": "WEB",
"url": "https://github.com/ohmyzsh/ohmyzsh/commit/06fc5fb"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-3JFQ-4F5C-MP6V
Vulnerability from github – Published: 2025-01-16 03:30 – Updated: 2025-01-16 15:32RE11S v1.11 was discovered to contain a command injection vulnerability via the component /goform/formAccept.
{
"affected": [],
"aliases": [
"CVE-2025-22912"
],
"database_specific": {
"cwe_ids": [
"CWE-77",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-16T03:15:06Z",
"severity": "CRITICAL"
},
"details": "RE11S v1.11 was discovered to contain a command injection vulnerability via the component /goform/formAccept.",
"id": "GHSA-3jfq-4f5c-mp6v",
"modified": "2025-01-16T15:32:10Z",
"published": "2025-01-16T03:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-22912"
},
{
"type": "WEB",
"url": "https://github.com/xyqer1/RE11S_1.11-formAccept-CommandInjection"
},
{
"type": "WEB",
"url": "https://www.edimax.com/edimax/global"
},
{
"type": "WEB",
"url": "http://re11s.com"
}
],
"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-3JG7-5HV4-35JM
Vulnerability from github – Published: 2022-05-14 01:51 – Updated: 2022-05-14 01:51Code injection in the /ui/login form Language parameter in Epicentro E_7.3.2+ allows attackers to execute JavaScript code by making a user issue a manipulated POST request.
{
"affected": [],
"aliases": [
"CVE-2018-7633"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-10-09T22:29:00Z",
"severity": "CRITICAL"
},
"details": "Code injection in the /ui/login form Language parameter in Epicentro E_7.3.2+ allows attackers to execute JavaScript code by making a user issue a manipulated POST request.",
"id": "GHSA-3jg7-5hv4-35jm",
"modified": "2022-05-14T01:51:33Z",
"published": "2022-05-14T01:51:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-7633"
},
{
"type": "WEB",
"url": "https://fschallock.wordpress.com/2018/10/08/cve-2018-7633-script-injection-in-the-login-form-language-parameter-of-adb-firmware-epicentro-7-3-2"
}
],
"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-3JGV-PFQJ-V626
Vulnerability from github – Published: 2024-04-26 06:30 – Updated: 2024-07-03 18:36Server-Side Template Injection (SSTI) vulnerability in inducer relate before v.2024.1 allows a remote attacker to execute arbitrary code via a crafted payload to the Batch-Issue Exam Tickets function.
{
"affected": [],
"aliases": [
"CVE-2024-32406"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-26T04:15:09Z",
"severity": "HIGH"
},
"details": "Server-Side Template Injection (SSTI) vulnerability in inducer relate before v.2024.1 allows a remote attacker to execute arbitrary code via a crafted payload to the Batch-Issue Exam Tickets function.",
"id": "GHSA-3jgv-pfqj-v626",
"modified": "2024-07-03T18:36:57Z",
"published": "2024-04-26T06:30:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32406"
},
{
"type": "WEB",
"url": "https://packetstormsecurity.com/files/178251/Relate-Learning-And-Teaching-System-SSTI-Remote-Code-Execution.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-3JM4-C6QF-JRH3
Vulnerability from github – Published: 2024-10-24 17:58 – Updated: 2024-12-04 22:18Summary
Lack of CSRF protection on the preview-expression command means that visiting a malicious website could cause an attacker-controlled expression to be executed. The expression can contain arbitrary Clojure or Python code.
The attacker must know a valid project ID of a project that contains at least one row.
Details
The com.google.refine.commands.expr.PreviewExpressionCommand class contains the following comment:
/**
* The command uses POST but does not actually modify any state so it does not require CSRF.
*/
However, this appears to be false (or no longer true). The expression being previewed (executed) can be written in GREL, Python, or Clojure. Since there are no restrictions on what code can be executed, the expression can do anything the user running OpenRefine can do. For instance, the following expressions start a calculator:
clojure:(.exec (Runtime/getRuntime) "gnome-calculator")
jython:import os;os.system("gnome-calculator")
The lack of restrictions on expressions is arguably not a problem if the user is typing their own expressions into OpenRefine: they could have just as well typed them into Clojure or Python directly. However, since the preview-expression command does not check for a CSRF token, the expression can actually come from a HTML form submitted by a different origin, including arbitrary websites.
Issue #2164 suggested adding CSRF protection to all endpoints, but this endpoint was skipped (and the above comment added) in the associated PR #2182.
PoC
An example "malicious" page is at https://wandernauta.nl/or/ (of course, actual malicious pages would not wait for the victim to press the submit button).
The following curl command (substituting the project ID) also demonstrates the issue:
curl -d project=123456789 -d cellIndex=1 -d rowIndices='[0]' -d 'expression=clojure:(.exec (Runtime/getRuntime) "gnome-calculator")' http://localhost:3333/command/core/preview-expression/
Impact
CSRF into remote code execution, provided the attacker knows at least one project ID in the victim's workspace and can convince the victim to open a malicious webpage.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.openrefine:main"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.8.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-47879"
],
"database_specific": {
"cwe_ids": [
"CWE-352",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-10-24T17:58:53Z",
"nvd_published_at": "2024-10-24T21:15:12Z",
"severity": "HIGH"
},
"details": "### Summary\n\nLack of CSRF protection on the `preview-expression` command means that visiting a malicious website could cause an attacker-controlled expression to be executed. The expression can contain arbitrary Clojure or Python code.\n\nThe attacker must know a valid project ID of a project that contains at least one row.\n\n### Details\n\nThe `com.google.refine.commands.expr.PreviewExpressionCommand` class contains the following comment:\n```\n/**\n * The command uses POST but does not actually modify any state so it does not require CSRF.\n */\n```\n\nHowever, this appears to be false (or no longer true). The expression being previewed (executed) can be written in GREL, Python, or Clojure. Since there are no restrictions on what code can be executed, the expression can do anything the user running OpenRefine can do. For instance, the following expressions start a calculator:\n\n```\nclojure:(.exec (Runtime/getRuntime) \"gnome-calculator\")\n```\n\n```\njython:import os;os.system(\"gnome-calculator\")\n```\n\nThe lack of restrictions on expressions is arguably not a problem if the user is typing their own expressions into OpenRefine: they could have just as well typed them into Clojure or Python directly. However, since the `preview-expression` command does not check for a CSRF token, the expression can actually come from a HTML form submitted by a different origin, including arbitrary websites.\n\nIssue #2164 suggested adding CSRF protection to all endpoints, but this endpoint was skipped (and the above comment added) in the associated PR #2182.\n\n### PoC\n\nAn example \"malicious\" page is at https://wandernauta.nl/or/ (of course, actual malicious pages would not wait for the victim to press the submit button).\n\nThe following curl command (substituting the project ID) also demonstrates the issue:\n\n```sh\ncurl -d project=123456789 -d cellIndex=1 -d rowIndices=\u0027[0]\u0027 -d \u0027expression=clojure:(.exec (Runtime/getRuntime) \"gnome-calculator\")\u0027 http://localhost:3333/command/core/preview-expression/\n```\n\n### Impact\n\nCSRF into remote code execution, provided the attacker knows at least one project ID in the victim\u0027s workspace and can convince the victim to open a malicious webpage.",
"id": "GHSA-3jm4-c6qf-jrh3",
"modified": "2024-12-04T22:18:02Z",
"published": "2024-10-24T17:58:53Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/OpenRefine/OpenRefine/security/advisories/GHSA-3jm4-c6qf-jrh3"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-47879"
},
{
"type": "WEB",
"url": "https://github.com/OpenRefine/OpenRefine/commit/090924ca923489b6c94397cf1f5df7f7f78f0126"
},
{
"type": "PACKAGE",
"url": "https://github.com/OpenRefine/OpenRefine"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "OpenRefine\u0027s PreviewExpressionCommand, which is eval, lacks protection against cross-site request forgery (CSRF)"
}
GHSA-3JPP-JWVR-524V
Vulnerability from github – Published: 2022-05-17 01:38 – Updated: 2022-05-17 01:38Eval injection vulnerability in the ReplaceListVars function in the template parser in e/class/connect.php in EmpireCMS 6.6 allows user-assisted remote attackers to execute arbitrary PHP code via a crafted template.
{
"affected": [],
"aliases": [
"CVE-2012-5777"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-11-16T00:55:00Z",
"severity": "MODERATE"
},
"details": "Eval injection vulnerability in the ReplaceListVars function in the template parser in e/class/connect.php in EmpireCMS 6.6 allows user-assisted remote attackers to execute arbitrary PHP code via a crafted template.",
"id": "GHSA-3jpp-jwvr-524v",
"modified": "2022-05-17T01:38:56Z",
"published": "2022-05-17T01:38:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-5777"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/79779"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2012-11/0027.html"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/117902/EmpireCMS-6.6-PHP-Code-Execution.html"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.org/files/117902/EmpireCMS-6.6-PHP-Code-Execution.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/56406"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-3JQ6-FX9W-PJQJ
Vulnerability from github – Published: 2022-05-01 23:39 – Updated: 2022-05-01 23:39CRLF injection vulnerability in Microsoft Internet Explorer 5 and 6 allows remote attackers to execute arbitrary FTP commands via an ftp:// URL that contains a URL-encoded CRLF (%0D%0A) before the FTP command, which causes the commands to be inserted into an authenticated FTP connection established earlier in the same browser session, as demonstrated using a DELE command, a variant or possibly a regression of CVE-2004-1166. NOTE: a trailing "//" can force Internet Explorer to try to reuse an existing authenticated connection.
{
"affected": [],
"aliases": [
"CVE-2008-1368"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-03-18T00:44:00Z",
"severity": "MODERATE"
},
"details": "CRLF injection vulnerability in Microsoft Internet Explorer 5 and 6 allows remote attackers to execute arbitrary FTP commands via an ftp:// URL that contains a URL-encoded CRLF (%0D%0A) before the FTP command, which causes the commands to be inserted into an authenticated FTP connection established earlier in the same browser session, as demonstrated using a DELE command, a variant or possibly a regression of CVE-2004-1166. NOTE: a trailing \"//\" can force Internet Explorer to try to reuse an existing authenticated connection.",
"id": "GHSA-3jq6-fx9w-pjqj",
"modified": "2022-05-01T23:39:31Z",
"published": "2022-05-01T23:39:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1368"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29346"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3750"
},
{
"type": "WEB",
"url": "http://www.rapid7.com/advisories/R7-0032.jsp"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/489500/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28208"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0870"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-3JQV-HHHV-7WP5
Vulnerability from github – Published: 2022-05-01 07:14 – Updated: 2022-05-01 07:14PHP remote file inclusion vulnerability in administrator/components/com_mgm/help.mgm.php in Mambo Gallery Manager (MGM) 0.95r2 and earlier for Mambo 4.5 allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.
{
"affected": [],
"aliases": [
"CVE-2006-3980"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-08-05T00:04:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in administrator/components/com_mgm/help.mgm.php in Mambo Gallery Manager (MGM) 0.95r2 and earlier for Mambo 4.5 allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.",
"id": "GHSA-3jqv-hhhv-7wp5",
"modified": "2022-05-01T07:14:12Z",
"published": "2022-05-01T07:14:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3980"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/28072"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2084"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/21268"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/1322"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/27650"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/441533/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/19224"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/3054"
}
],
"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.