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.
8357 vulnerabilities reference this CWE, most recent first.
GHSA-P52P-HQ77-4MJ2
Vulnerability from github – Published: 2022-05-02 00:00 – Updated: 2022-05-02 00:00Apple iTunes before 10.5.1 does not properly verify the authenticity of updates, which allows man-in-the-middle attackers to execute arbitrary code via a Trojan horse update, as demonstrated by evilgrade and DNS cache poisoning.
{
"affected": [],
"aliases": [
"CVE-2008-3434"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-08-01T14:41:00Z",
"severity": "HIGH"
},
"details": "Apple iTunes before 10.5.1 does not properly verify the authenticity of updates, which allows man-in-the-middle attackers to execute arbitrary code via a Trojan horse update, as demonstrated by evilgrade and DNS cache poisoning.",
"id": "GHSA-p52p-hq77-4mj2",
"modified": "2022-05-02T00:00:06Z",
"published": "2022-05-02T00:00:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-3434"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A17136"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2008-07/0250.html"
},
{
"type": "WEB",
"url": "http://lists.apple.com/archives/Security-announce/2011/Nov/msg00003.html"
},
{
"type": "WEB",
"url": "http://support.apple.com/kb/HT5030"
},
{
"type": "WEB",
"url": "http://www.infobyte.com.ar/down/Francisco%20Amato%20-%20evilgrade%20-%20ENG.pdf"
},
{
"type": "WEB",
"url": "http://www.infobyte.com.ar/down/isr-evilgrade-1.0.0.tar.gz"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P548-Q955-GCWG
Vulnerability from github – Published: 2022-05-02 03:41 – Updated: 2022-05-02 03:41The RSS reader widget in IBM Lotus Notes 8.0 and 8.5 saves items from an RSS feed as local HTML documents, which allows remote attackers to execute arbitrary script in Internet Explorer's Local Machine Zone via a crafted feed, aka SPR RGAU7RDJ9K.
{
"affected": [],
"aliases": [
"CVE-2009-3114"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-09-09T22:30:00Z",
"severity": "HIGH"
},
"details": "The RSS reader widget in IBM Lotus Notes 8.0 and 8.5 saves items from an RSS feed as local HTML documents, which allows remote attackers to execute arbitrary script in Internet Explorer\u0027s Local Machine Zone via a crafted feed, aka SPR RGAU7RDJ9K.",
"id": "GHSA-p548-q955-gcwg",
"modified": "2022-05-02T03:41:46Z",
"published": "2022-05-02T03:41:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-3114"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36813"
},
{
"type": "WEB",
"url": "http://www-01.ibm.com/support/docview.wss?uid=swg21403834"
},
{
"type": "WEB",
"url": "http://www.scip.ch/?vuldb.4021"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/506296/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/36305"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P572-G32F-HP32
Vulnerability from github – Published: 2026-02-18 09:31 – Updated: 2026-02-18 09:31The Product Addons for Woocommerce – Product Options with Custom Fields plugin for WordPress is vulnerable to Code Injection in all versions up to, and including, 3.1.0. This is due to insufficient input validation of the 'operator' field in conditional logic rules within the evalConditions() function, which passes unsanitized user input directly to PHP's eval() function. This makes it possible for authenticated attackers, with Shop Manager-level access and above, to inject and execute arbitrary PHP code on the server via the conditional logic 'operator' parameter when saving addon form field rules.
{
"affected": [],
"aliases": [
"CVE-2026-2296"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-18T07:16:10Z",
"severity": "HIGH"
},
"details": "The Product Addons for Woocommerce \u2013 Product Options with Custom Fields plugin for WordPress is vulnerable to Code Injection in all versions up to, and including, 3.1.0. This is due to insufficient input validation of the \u0027operator\u0027 field in conditional logic rules within the evalConditions() function, which passes unsanitized user input directly to PHP\u0027s eval() function. This makes it possible for authenticated attackers, with Shop Manager-level access and above, to inject and execute arbitrary PHP code on the server via the conditional logic \u0027operator\u0027 parameter when saving addon form field rules.",
"id": "GHSA-p572-g32f-hp32",
"modified": "2026-02-18T09:31:04Z",
"published": "2026-02-18T09:31:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-2296"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/woo-custom-product-addons/tags/3.0.19/includes/process/conditional-logic.php#L104"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/woo-custom-product-addons/tags/3.0.19/includes/process/conditional-logic.php#L84"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/woo-custom-product-addons/trunk/includes/process/conditional-logic.php#L104"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/woo-custom-product-addons/trunk/includes/process/conditional-logic.php#L84"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset?sfp_email=\u0026sfph_mail=\u0026reponame=\u0026old=3458823%40woo-custom-product-addons\u0026new=3458823%40woo-custom-product-addons\u0026sfp_email=\u0026sfph_mail="
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/b3c1edd7-2421-4dfa-8775-ca0497759d52?source=cve"
}
],
"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-P5FJ-7PGR-XV7V
Vulnerability from github – Published: 2022-05-02 03:35 – Updated: 2025-04-09 04:12js/src/jstracer.cpp in the Just-in-time (JIT) JavaScript compiler (aka TraceMonkey) in Mozilla Firefox 3.5 before 3.5.1 allows remote attackers to execute arbitrary code via certain use of the escape function that triggers access to uninitialized memory locations, as originally demonstrated by a document containing P and FONT elements.
{
"affected": [],
"aliases": [
"CVE-2009-2477"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-07-15T15:30:00Z",
"severity": "HIGH"
},
"details": "js/src/jstracer.cpp in the Just-in-time (JIT) JavaScript compiler (aka TraceMonkey) in Mozilla Firefox 3.5 before 3.5.1 allows remote attackers to execute arbitrary code via certain use of the escape function that triggers access to uninitialized memory locations, as originally demonstrated by a document containing P and FONT elements.",
"id": "GHSA-p5fj-7pgr-xv7v",
"modified": "2025-04-09T04:12:00Z",
"published": "2022-05-02T03:35:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2477"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=503286"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/40936"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-July/msg00909.html"
},
{
"type": "WEB",
"url": "http://blog.mozilla.com/security/2009/07/14/critical-javascript-vulnerability-in-firefox-35"
},
{
"type": "WEB",
"url": "http://isc.sans.org/diary.html?storyid=6796"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35798"
},
{
"type": "WEB",
"url": "http://sunsolve.sun.com/search/document.do?assetkey=1-66-266148-1"
},
{
"type": "WEB",
"url": "http://voices.washingtonpost.com/securityfix/2009/07/stopgap_fix_for_critical_firef.html"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/9137"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/9181"
},
{
"type": "WEB",
"url": "http://www.h-online.com/security/First-Zero-Day-Exploit-for-Firefox-3-5--/news/113761"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/443060"
},
{
"type": "WEB",
"url": "http://www.mozilla.org/security/announce/2009/mfsa2009-41.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/35660"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/1868"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P5HG-3XM3-GCJG
Vulnerability from github – Published: 2018-10-17 20:05 – Updated: 2025-01-31 18:51Spring Framework, versions 5.0 prior to 5.0.5 and versions 4.3 prior to 4.3.16 and older unsupported versions, allow applications to expose STOMP over WebSocket endpoints with a simple, in-memory STOMP broker through the spring-messaging module. A malicious user (or attacker) can craft a message to the broker that can lead to a remote code execution attack.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.springframework:spring-messaging"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0.RELEASE"
},
{
"fixed": "5.0.5.RELEASE"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.springframework:spring-messaging"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.3.16.RELEASE"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2018-1270"
],
"database_specific": {
"cwe_ids": [
"CWE-358",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:47:59Z",
"nvd_published_at": "2018-04-06T13:29:00Z",
"severity": "CRITICAL"
},
"details": "Spring Framework, versions 5.0 prior to 5.0.5 and versions 4.3 prior to 4.3.16 and older unsupported versions, allow applications to expose STOMP over WebSocket endpoints with a simple, in-memory STOMP broker through the spring-messaging module. A malicious user (or attacker) can craft a message to the broker that can lead to a remote code execution attack.",
"id": "GHSA-p5hg-3xm3-gcjg",
"modified": "2025-01-31T18:51:12Z",
"published": "2018-10-17T20:05:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-1270"
},
{
"type": "WEB",
"url": "https://github.com/spring-projects/spring-framework/commit/0009806debb578e884f6dc98bd1f2dc668020021"
},
{
"type": "WEB",
"url": "https://github.com/spring-projects/spring-framework/commit/e0de9126ed8cf25cf141d3e66420da94e350708a"
},
{
"type": "WEB",
"url": "https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpuoct2021.html"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cpujul2020.html"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/44796"
},
{
"type": "WEB",
"url": "https://web.archive.org/web/20200227125035/https://www.securityfocus.com/bid/103696"
},
{
"type": "WEB",
"url": "https://pivotal.io/security/cve-2018-1270"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2021/04/msg00022.html"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2@%3Cissues.geode.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/dcf8599b80e43a6b60482607adb76c64672772dc2d9209ae2170f369@%3Cissues.activemq.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/ab825fcade0b49becfa30235b3d54f4a51bb74ea96b6c9adb5d1378c@%3Cissues.activemq.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/6d3d34adcf3dfc48e36342aa1f18ce3c20bb8e4c458a97508d5bfed1@%3Cissues.activemq.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/4ed49b103f64a0cecb38064f26cbf1389afc12124653da2d35166dbe@%3Cissues.activemq.apache.org%3E"
},
{
"type": "PACKAGE",
"url": "https://github.com/spring-projects/spring-framework"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2018:2939"
},
{
"type": "WEB",
"url": "http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html"
},
{
"type": "WEB",
"url": "http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html"
}
],
"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"
}
],
"summary": "Spring Framework allows applications to expose STOMP over WebSocket endpoints"
}
GHSA-P5HJ-XXFR-PWC3
Vulnerability from github – Published: 2022-01-21 18:02 – Updated: 2026-02-27 20:10Cross-site Scripting in Packagist microweber/microweber prior to 1.2.11.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "microweber/microweber"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.2.11"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-0282"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-01-21T16:58:03Z",
"nvd_published_at": "2022-01-20T12:15:00Z",
"severity": "HIGH"
},
"details": "Cross-site Scripting in Packagist microweber/microweber prior to 1.2.11.",
"id": "GHSA-p5hj-xxfr-pwc3",
"modified": "2026-02-27T20:10:28Z",
"published": "2022-01-21T18:02:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-0282"
},
{
"type": "WEB",
"url": "https://github.com/microweber/microweber/commit/51b5a4e3ef01e587797c0109159a8ad9d2bac77a"
},
{
"type": "PACKAGE",
"url": "https://github.com/microweber/microweber"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/8815b642-bd9b-4737-951b-bde7319faedd"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Code Injection in microweber"
}
GHSA-P5JH-X5GW-RM3F
Vulnerability from github – Published: 2026-06-15 21:30 – Updated: 2026-06-16 15:33An OS command injection vulnerability in the media archiving and export pipeline component of kanishka-linux Reminiscence v0.3.0 allows attackers to execute arbitrary commands via supplying a crafted input.
{
"affected": [],
"aliases": [
"CVE-2026-50871"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-06-15T20:16:29Z",
"severity": "CRITICAL"
},
"details": "An OS command injection vulnerability in the media archiving and export pipeline component of kanishka-linux Reminiscence v0.3.0 allows attackers to execute arbitrary commands via supplying a crafted input.",
"id": "GHSA-p5jh-x5gw-rm3f",
"modified": "2026-06-16T15:33:47Z",
"published": "2026-06-15T21:30:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-50871"
},
{
"type": "WEB",
"url": "https://gist.github.com/pyuysig/01f00b5d7575f5a776b1f132ef9ecb46"
}
],
"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-P5JM-J9RM-7M7M
Vulnerability from github – Published: 2024-07-19 15:31 – Updated: 2024-08-01 15:32D-Link DIR-823X AX3000 Dual-Band Gigabit Wireless Router v21_D240126 was discovered to contain a remote code execution (RCE) vulnerability in the ntp_zone_val parameter at /goform/set_ntp. This vulnerability is exploited via a crafted HTTP request.
{
"affected": [],
"aliases": [
"CVE-2024-39962"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-07-19T15:15:10Z",
"severity": "CRITICAL"
},
"details": "D-Link DIR-823X AX3000 Dual-Band Gigabit Wireless Router v21_D240126 was discovered to contain a remote code execution (RCE) vulnerability in the ntp_zone_val parameter at /goform/set_ntp. This vulnerability is exploited via a crafted HTTP request.",
"id": "GHSA-p5jm-j9rm-7m7m",
"modified": "2024-08-01T15:32:06Z",
"published": "2024-07-19T15:31:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-39962"
},
{
"type": "WEB",
"url": "https://gist.github.com/Swind1er/40c33f1b1549028677cb4e2e5ef69109"
}
],
"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-P5M4-XQJQ-89Q2
Vulnerability from github – Published: 2025-01-14 18:31 – Updated: 2025-01-31 18:31A remote code execution (RCE) vulnerability in Arcadyan Meteor 2 CPE FG360 Firmware ETV2.10 allows attackers to execute arbitrary code via a crafted request.
{
"affected": [],
"aliases": [
"CVE-2024-53561"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-14T17:15:17Z",
"severity": "HIGH"
},
"details": "A remote code execution (RCE) vulnerability in Arcadyan Meteor 2 CPE FG360 Firmware ETV2.10 allows attackers to execute arbitrary code via a crafted request.",
"id": "GHSA-p5m4-xqjq-89q2",
"modified": "2025-01-31T18:31:05Z",
"published": "2025-01-14T18:31:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-53561"
},
{
"type": "WEB",
"url": "https://github.com/Mrnmap/mrnmap-cve/blob/main/CVE-2024-53561"
},
{
"type": "WEB",
"url": "https://www.arcadyan.com/en-us/solutions/idea/fiveG"
}
],
"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:N",
"type": "CVSS_V3"
}
]
}
GHSA-P5P5-58VG-RV6H
Vulnerability from github – Published: 2024-10-25 09:32 – Updated: 2024-10-25 09:32N-LINE 2.0.6 and prior versions contain a code injection vulnerability. If this vulnerability is exploited, arbitrary code may be executed on the instructor's browser, or the instructor may be directed to a malicious website.
{
"affected": [],
"aliases": [
"CVE-2024-47158"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-10-25T08:15:03Z",
"severity": "HIGH"
},
"details": "N-LINE 2.0.6 and prior versions contain a code injection vulnerability. If this vulnerability is exploited, arbitrary code may be executed on the instructor\u0027s browser, or the instructor may be directed to a malicious website.",
"id": "GHSA-p5p5-58vg-rv6h",
"modified": "2024-10-25T09:32:01Z",
"published": "2024-10-25T09:32:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-47158"
},
{
"type": "WEB",
"url": "https://jvn.jp/en/jp/JVN57285747"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L",
"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.