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.
8402 vulnerabilities reference this CWE, most recent first.
GHSA-5G73-69P4-7GVX
Vulnerability from github – Published: 2024-01-22 03:30 – Updated: 2024-01-29 21:53GenerateSDFPipeline in synthetic_dataframe in PandasAI (aka pandas-ai) through 1.5.17 allows attackers to trigger the generation of arbitrary Python code that is executed by SDFCodeExecutor. An attacker can create a dataframe that provides an English language specification of this Python code. NOTE: the vendor previously attempted to restrict code execution in response to a separate issue, CVE-2023-39660.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "pandasai"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.5.17"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-23752"
],
"database_specific": {
"cwe_ids": [
"CWE-862",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-01-22T21:28:23Z",
"nvd_published_at": "2024-01-22T01:15:08Z",
"severity": "CRITICAL"
},
"details": "GenerateSDFPipeline in synthetic_dataframe in PandasAI (aka pandas-ai) through 1.5.17 allows attackers to trigger the generation of arbitrary Python code that is executed by SDFCodeExecutor. An attacker can create a dataframe that provides an English language specification of this Python code. NOTE: the vendor previously attempted to restrict code execution in response to a separate issue, CVE-2023-39660.",
"id": "GHSA-5g73-69p4-7gvx",
"modified": "2024-01-29T21:53:03Z",
"published": "2024-01-22T03:30:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-23752"
},
{
"type": "WEB",
"url": "https://github.com/gventuri/pandas-ai/issues/868"
},
{
"type": "PACKAGE",
"url": "https://github.com/gventuri/pandas-ai"
}
],
"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": "Code execution in pandasai"
}
GHSA-5G82-GG27-R8VP
Vulnerability from github – Published: 2026-02-16 18:31 – Updated: 2026-02-18 15:31An issue in the code-runner.executorMap setting of Visual Studio Code Extensions Code Runner v0.12.2 allows attackers to execute arbitrary code when opening a crafted workspace.
{
"affected": [],
"aliases": [
"CVE-2025-65715"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-16T16:19:17Z",
"severity": "HIGH"
},
"details": "An issue in the code-runner.executorMap setting of Visual Studio Code Extensions Code Runner v0.12.2 allows attackers to execute arbitrary code when opening a crafted workspace.",
"id": "GHSA-5g82-gg27-r8vp",
"modified": "2026-02-18T15:31:24Z",
"published": "2026-02-16T18:31:28Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-65715"
},
{
"type": "WEB",
"url": "https://github.com/formulahendry/vscode-code-runner"
},
{
"type": "WEB",
"url": "https://www.ox.security/blog/cve-2025-65715-code-runner-vscode-rce"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-5GC4-CX9X-9C43
Vulnerability from github – Published: 2022-06-09 00:00 – Updated: 2022-06-20 22:01The package metacalc before 0.0.2 is vulnerable to Arbitrary Code Execution when it exposes JavaScript's Math class to the v8 context. As the Math class is exposed to user-land, it can be used to get access to JavaScript's Function constructor.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "metacalc"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-21122"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2022-06-09T23:50:50Z",
"nvd_published_at": "2022-06-08T09:15:00Z",
"severity": "CRITICAL"
},
"details": "The package metacalc before 0.0.2 is vulnerable to Arbitrary Code Execution when it exposes JavaScript\u0027s Math class to the v8 context. As the Math class is exposed to user-land, it can be used to get access to JavaScript\u0027s Function constructor.",
"id": "GHSA-5gc4-cx9x-9c43",
"modified": "2022-06-20T22:01:28Z",
"published": "2022-06-09T00:00:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-21122"
},
{
"type": "WEB",
"url": "https://github.com/metarhia/metacalc/pull/16"
},
{
"type": "WEB",
"url": "https://github.com/metarhia/metacalc/commit/625c23d63eabfa16fc815f5832b147b08d2144bd"
},
{
"type": "PACKAGE",
"url": "https://github.com/metarhia/metacalc"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-METACALC-2826197"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Code Injection in metacalc"
}
GHSA-5GC8-V95Q-VQ8H
Vulnerability from github – Published: 2022-05-02 03:14 – Updated: 2022-05-02 03:14Multiple PHP remote file inclusion vulnerabilities in WB News 2.0.1, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the config[installdir] parameter to (1) search.php, (2) archive.php, (3) comments.php, and (4) news.php; (5) News.php, (6) SendFriend.php, (7) Archive.php, and (8) Comments.php in base/; and possibly other components, different vectors than CVE-2007-1288.
{
"affected": [],
"aliases": [
"CVE-2009-0294"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-01-27T20:30:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in WB News 2.0.1, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the config[installdir] parameter to (1) search.php, (2) archive.php, (3) comments.php, and (4) news.php; (5) News.php, (6) SendFriend.php, (7) Archive.php, and (8) Comments.php in base/; and possibly other components, different vectors than CVE-2007-1288.",
"id": "GHSA-5gc8-v95q-vq8h",
"modified": "2022-05-02T03:14:08Z",
"published": "2022-05-02T03:14:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-0294"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/33691"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/500398/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/33434"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-5GFP-86VP-F9MF
Vulnerability from github – Published: 2026-05-19 12:31 – Updated: 2026-05-19 21:32Improper Control of Generation of Code ('Code Injection') vulnerability in email services of Apache OFBiz.
This issue affects Apache OFBiz: before 24.09.06.
Users are recommended to upgrade to version 24.09.06, which fixes the issue.
{
"affected": [],
"aliases": [
"CVE-2026-35086"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-19T10:16:24Z",
"severity": "MODERATE"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in email services of Apache OFBiz.\n\nThis issue affects Apache OFBiz: before 24.09.06.\n\nUsers are recommended to upgrade to version 24.09.06, which fixes the issue.",
"id": "GHSA-5gfp-86vp-f9mf",
"modified": "2026-05-19T21:32:02Z",
"published": "2026-05-19T12:31:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-35086"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/g0s37yhnh2xwfts400crb2w8s337hgjx"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2026/05/19/26"
}
],
"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:N",
"type": "CVSS_V3"
}
]
}
GHSA-5GG9-WWJM-FRFP
Vulnerability from github – Published: 2026-06-24 15:31 – Updated: 2026-06-24 15:31The AdRotate Banner Manager plugin for WordPress is vulnerable to PHP Code Injection in all versions up to, and including, 5.17.7 via the 'banner' attribute of the adrotate shortcode. This is due to insufficient input validation and sanitization of the banner shortcode attribute before concatenation into a PHP code string wrapped in W3 Total Cache mfunc or Borlabs Cache fragment markers. This makes it possible for authenticated attackers, with Contributor-level access and above, to execute arbitrary PHP code on the server. This vulnerability requires W3 Total Cache or Borlabs Cache support to be enabled in AdRotate settings.
{
"affected": [],
"aliases": [
"CVE-2026-12242"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-06-24T13:16:31Z",
"severity": "HIGH"
},
"details": "The AdRotate Banner Manager plugin for WordPress is vulnerable to PHP Code Injection in all versions up to, and including, 5.17.7 via the \u0027banner\u0027 attribute of the adrotate shortcode. This is due to insufficient input validation and sanitization of the banner shortcode attribute before concatenation into a PHP code string wrapped in W3 Total Cache mfunc or Borlabs Cache fragment markers. This makes it possible for authenticated attackers, with Contributor-level access and above, to execute arbitrary PHP code on the server. This vulnerability requires W3 Total Cache or Borlabs Cache support to be enabled in AdRotate settings.",
"id": "GHSA-5gg9-wwjm-frfp",
"modified": "2026-06-24T15:31:45Z",
"published": "2026-06-24T15:31:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-12242"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/tags/5.17.4/adrotate-output.php#L265"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/tags/5.17.4/adrotate-output.php#L276"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/tags/5.17.4/adrotate-output.php#L288"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/tags/5.17.5/adrotate-output.php#L265"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/tags/5.17.5/adrotate-output.php#L276"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/tags/5.17.5/adrotate-output.php#L288"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/trunk/adrotate-output.php#L265"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/trunk/adrotate-output.php#L276"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/adrotate/trunk/adrotate-output.php#L288"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3582562"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/f29b905c-57cf-4fb8-b6af-eb0c367cd3e4?source=cve"
}
],
"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"
}
]
}
GHSA-5GHX-9783-29RC
Vulnerability from github – Published: 2026-05-07 15:38 – Updated: 2026-07-28 15:31Other issue in the WebRTC component. This vulnerability was fixed in Firefox ESR 140.10.2.
{
"affected": [],
"aliases": [
"CVE-2026-8094"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-07T13:16:14Z",
"severity": "CRITICAL"
},
"details": "Other issue in the WebRTC component. This vulnerability was fixed in Firefox ESR 140.10.2.",
"id": "GHSA-5ghx-9783-29rc",
"modified": "2026-07-28T15:31:54Z",
"published": "2026-05-07T15:38:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-8094"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-44"
},
{
"type": "WEB",
"url": "https://www.mozilla.org/security/advisories/mfsa2026-41"
},
{
"type": "WEB",
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-8094.json"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2467706"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=2035939"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-8094"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26539"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26536"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26521"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26270"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26269"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26268"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:26174"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:25015"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24983"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24755"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24516"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24511"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24510"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24509"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:24508"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:22643"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:22325"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:21381"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:20574"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:20566"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:19160"
}
],
"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-5GJV-H9VC-2W8G
Vulnerability from github – Published: 2025-12-31 21:30 – Updated: 2025-12-31 21:30A security vulnerability has been detected in Kohana KodiCMS up to 13.82.135. This impacts the function Save of the file cms/modules/kodicms/classes/kodicms/model/file.php of the component Layout API Endpoint. The manipulation of the argument content leads to code injection. The attack can be initiated remotely. The exploit has been disclosed publicly and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
{
"affected": [],
"aliases": [
"CVE-2025-15393"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-31T19:15:43Z",
"severity": "MODERATE"
},
"details": "A security vulnerability has been detected in Kohana KodiCMS up to 13.82.135. This impacts the function Save of the file cms/modules/kodicms/classes/kodicms/model/file.php of the component Layout API Endpoint. The manipulation of the argument content leads to code injection. The attack can be initiated remotely. The exploit has been disclosed publicly and may be used. The vendor was contacted early about this disclosure but did not respond in any way.",
"id": "GHSA-5gjv-h9vc-2w8g",
"modified": "2025-12-31T21:30:57Z",
"published": "2025-12-31T21:30:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-15393"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.339162"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.339162"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.718290"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-5GMQ-7HWH-FXJ9
Vulnerability from github – Published: 2022-09-07 00:01 – Updated: 2025-06-12 15:31An issue was discovered in OpenRemote through 1.0.4 allows attackers to execute arbitrary code via a crafted Groovy rule.
{
"affected": [],
"aliases": [
"CVE-2022-31860"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-09-06T18:15:00Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in OpenRemote through 1.0.4 allows attackers to execute arbitrary code via a crafted Groovy rule.",
"id": "GHSA-5gmq-7hwh-fxj9",
"modified": "2025-06-12T15:31:16Z",
"published": "2022-09-07T00:01:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-31860"
},
{
"type": "WEB",
"url": "https://github.com/openremote/openremote"
},
{
"type": "WEB",
"url": "https://securityblog101.blogspot.com/2022/09/cve-2022-31860.html"
},
{
"type": "WEB",
"url": "https://stackoverflow.com/questions/159148/groovy-executing-shell-commands"
},
{
"type": "WEB",
"url": "https://stackoverflow.com/questions/66069960/groovy-shell-sandboxing-best-practices"
}
],
"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-5GWJ-42JG-VG3V
Vulnerability from github – Published: 2022-05-02 00:00 – Updated: 2022-05-02 00:00LinkedIn Browser Toolbar 3.0.3.1100 and earlier 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-3435"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-08-01T14:41:00Z",
"severity": "HIGH"
},
"details": "LinkedIn Browser Toolbar 3.0.3.1100 and earlier 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-5gwj-42jg-vg3v",
"modified": "2022-05-02T00:00:07Z",
"published": "2022-05-02T00:00:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-3435"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2008-07/0250.html"
},
{
"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": []
}
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.