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.
8313 vulnerabilities reference this CWE, most recent first.
GHSA-P9QC-8JJX-G8CG
Vulnerability from github – Published: 2025-07-03 21:31 – Updated: 2025-07-07 19:10Bolt CMS versions 3.7.0 and earlier contain a chain of vulnerabilities that together allow an authenticated user to achieve remote code execution. A user with valid credentials can inject arbitrary PHP code into the displayname field of the user profile, which is rendered unsanitized in backend templates. The attacker can then list and rename cached session files via the /async/browse/cache/.sessions and /async/folder/rename endpoints. By renaming a .session file to a path under the publicly accessible /files/ directory with a .php extension, the attacker can turn the injected code into an executable web shell. Finally, the attacker triggers the payload via a crafted HTTP GET request to the rogue file.
NOTE: The vendor announced that Bolt 3 reached end-of-life after 31 December 2021.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "bolt/bolt"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "3.7.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-34086"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-07-07T19:10:40Z",
"nvd_published_at": "2025-07-03T20:15:22Z",
"severity": "HIGH"
},
"details": "Bolt CMS versions 3.7.0 and earlier contain a chain of vulnerabilities that together allow an authenticated user to achieve remote code execution. A user with valid credentials can inject arbitrary PHP code into the displayname field of the user profile, which is rendered unsanitized in backend templates. The attacker can then list and rename cached session files via the /async/browse/cache/.sessions and /async/folder/rename endpoints. By renaming a .session file to a path under the publicly accessible /files/ directory with a .php extension, the attacker can turn the injected code into an executable web shell. Finally, the attacker triggers the payload via a crafted HTTP GET request to the rogue file.\n\nNOTE: The vendor announced that Bolt 3 reached end-of-life after 31 December 2021.",
"id": "GHSA-p9qc-8jjx-g8cg",
"modified": "2025-07-07T19:10:40Z",
"published": "2025-07-03T21:31:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-34086"
},
{
"type": "WEB",
"url": "https://boltcms.io/newsitem/major-announcements-bolt-3-eol-bolt-4-2-5-0-releases"
},
{
"type": "PACKAGE",
"url": "https://github.com/bolt/bolt"
},
{
"type": "WEB",
"url": "https://github.com/bolt/bolt/blob/3.7/src/Controller/Backend/Users.php#L279-L311"
},
{
"type": "WEB",
"url": "https://github.com/bolt/bolt/releases/tag/3.7.1"
},
{
"type": "WEB",
"url": "https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/unix/webapp/bolt_authenticated_rce.rb"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/48296"
},
{
"type": "WEB",
"url": "https://www.rapid7.com/db/modules/exploit/unix/webapp/bolt_authenticated_rce"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Bolt CMS vulnerable to authenticated remote code execution"
}
GHSA-P9R7-XJ7P-2MW2
Vulnerability from github – Published: 2022-05-17 00:42 – Updated: 2022-05-17 00:42Multiple PHP remote file inclusion vulnerabilities in the Recly!Competitions (com_competitions) component 1.0 for Joomla! allow remote attackers to execute arbitrary PHP code via a URL in the (1) GLOBALS[mosConfig_absolute_path] parameter to (a) add.php and (b) competitions.php in includes/competitions/, and the (2) mosConfig_absolute_path parameter to (c) includes/settings/settings.php.
{
"affected": [],
"aliases": [
"CVE-2008-5790"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-12-31T11:30:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in the Recly!Competitions (com_competitions) component 1.0 for Joomla! allow remote attackers to execute arbitrary PHP code via a URL in the (1) GLOBALS[mosConfig_absolute_path] parameter to (a) add.php and (b) competitions.php in includes/competitions/, and the (2) mosConfig_absolute_path parameter to (c) includes/settings/settings.php.",
"id": "GHSA-p9r7-xj7p-2mw2",
"modified": "2022-05-17T00:42:53Z",
"published": "2022-05-17T00:42:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5790"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7039"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32192"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PC5X-FVX9-JF5H
Vulnerability from github – Published: 2022-05-24 19:13 – Updated: 2022-07-13 00:01Barco MirrorOp Windows Sender before 2.5.3.65 uses cleartext HTTP and thus allows rogue software upgrades. An attacker on the local network can achieve remote code execution on any computer that tries to update Windows Sender due to the fact that the upgrade mechanism is not secured (is not protected with TLS).
{
"affected": [],
"aliases": [
"CVE-2021-38142"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-09-07T18:15:00Z",
"severity": "HIGH"
},
"details": "Barco MirrorOp Windows Sender before 2.5.3.65 uses cleartext HTTP and thus allows rogue software upgrades. An attacker on the local network can achieve remote code execution on any computer that tries to update Windows Sender due to the fact that the upgrade mechanism is not secured (is not protected with TLS).",
"id": "GHSA-pc5x-fvx9-jf5h",
"modified": "2022-07-13T00:01:34Z",
"published": "2022-05-24T19:13:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-38142"
},
{
"type": "WEB",
"url": "https://www.barco.com/en/support/cms"
},
{
"type": "WEB",
"url": "https://www.barco.com/en/support/software/R33050099?majorVersion=2\u0026minorVersion=5\u0026patchVersion=3\u0026buildVersion=65"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-PC6R-6288-XQWH
Vulnerability from github – Published: 2022-05-02 06:13 – Updated: 2025-04-11 03:31vbscript.dll in VBScript 5.1, 5.6, 5.7, and 5.8 in Microsoft Windows 2000 SP4, XP SP2 and SP3, and Server 2003 SP2, when Internet Explorer is used, allows user-assisted remote attackers to execute arbitrary code by referencing a (1) local pathname, (2) UNC share pathname, or (3) WebDAV server with a crafted .hlp file in the fourth argument (aka helpfile argument) to the MsgBox function, leading to code execution involving winhlp32.exe when the F1 key is pressed, aka "VBScript Help Keypress Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2010-0483"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-03-03T19:30:00Z",
"severity": "HIGH"
},
"details": "vbscript.dll in VBScript 5.1, 5.6, 5.7, and 5.8 in Microsoft Windows 2000 SP4, XP SP2 and SP3, and Server 2003 SP2, when Internet Explorer is used, allows user-assisted remote attackers to execute arbitrary code by referencing a (1) local pathname, (2) UNC share pathname, or (3) WebDAV server with a crafted .hlp file in the fourth argument (aka helpfile argument) to the MsgBox function, leading to code execution involving winhlp32.exe when the F1 key is pressed, aka \"VBScript Help Keypress Vulnerability.\"",
"id": "GHSA-pc6r-6288-xqwh",
"modified": "2025-04-11T03:31:56Z",
"published": "2022-05-02T06:13:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-0483"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-022"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/56558"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7170"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A8654"
},
{
"type": "WEB",
"url": "https://www.metasploit.com/svn/framework3/trunk/modules/exploits/windows/browser/ie_winhlp32.rb"
},
{
"type": "WEB",
"url": "http://blogs.technet.com/msrc/archive/2010/02/28/investigating-a-new-win32hlp-and-internet-explorer-issue.aspx"
},
{
"type": "WEB",
"url": "http://blogs.technet.com/msrc/archive/2010/03/01/security-advisory-981169-released.aspx"
},
{
"type": "WEB",
"url": "http://blogs.technet.com/srd/archive/2010/03/01/help-keypress-vulnerability-in-vbscript-enabling-remote-code-execution.aspx"
},
{
"type": "WEB",
"url": "http://isec.pl/vulnerabilities/isec-0027-msgbox-helpfile-ie.txt"
},
{
"type": "WEB",
"url": "http://isec.pl/vulnerabilities10.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38727"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1023668"
},
{
"type": "WEB",
"url": "http://www.computerworld.com/s/article/9163298/New_zero_day_involves_IE_puts_Windows_XP_users_at_risk"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/612021"
},
{
"type": "WEB",
"url": "http://www.microsoft.com/technet/security/advisory/981169.mspx"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/62632"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/38463"
},
{
"type": "WEB",
"url": "http://www.theregister.co.uk/2010/03/01/ie_code_execution_bug"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA10-103A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/0485"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PC74-63G2-PJP2
Vulnerability from github – Published: 2022-05-02 06:10 – Updated: 2025-04-11 03:31Adobe Flash Player before 10.0.45.2 and Adobe AIR before 1.5.3.9130 allow remote attackers to cause a denial of service (application crash) via a modified SWF file.
{
"affected": [],
"aliases": [
"CVE-2010-0187"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-02-15T18:30:00Z",
"severity": "MODERATE"
},
"details": "Adobe Flash Player before 10.0.45.2 and Adobe AIR before 1.5.3.9130 allow remote attackers to cause a denial of service (application crash) via a modified SWF file.",
"id": "GHSA-pc74-63g2-pjp2",
"modified": "2025-04-11T03:31:32Z",
"published": "2022-05-02T06:10:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-0187"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=564287"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A16125"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A8393"
},
{
"type": "WEB",
"url": "https://rhn.redhat.com/errata/RHSA-2010-0102.html"
},
{
"type": "WEB",
"url": "http://lists.apple.com/archives/security-announce/2010//Jun/msg00001.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2010-03/msg00004.html"
},
{
"type": "WEB",
"url": "http://sebug.net/exploit/18967"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38547"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38915"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/40220"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/43026"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-201101-09.xml"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1023585"
},
{
"type": "WEB",
"url": "http://support.apple.com/kb/HT4188"
},
{
"type": "WEB",
"url": "http://www.adobe.com/support/security/bulletins/apsb10-06.html"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/11182"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/38200"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/1481"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2011/0192"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PC79-P3CX-HCJP
Vulnerability from github – Published: 2025-10-31 00:30 – Updated: 2025-11-06 18:32Nagios Log Server versions prior to 2024R1.3.1 contain a code injection vulnerability where malformed dashboard ID values are not properly validated before being forwarded to an internal API. An attacker able to supply crafted dashboard ID values can cause the system to execute attacker-controlled data, leading to arbitrary code execution in the context of the Log Server process.
{
"affected": [],
"aliases": [
"CVE-2025-34277"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-10-30T22:15:48Z",
"severity": "CRITICAL"
},
"details": "Nagios Log Server versions prior to\u00a02024R1.3.1 contain a code injection vulnerability where\u00a0malformed dashboard ID values are not properly validated before being forwarded to an internal API.\u00a0An attacker able to supply crafted dashboard ID values can cause the system to execute attacker-controlled data, leading to arbitrary code execution in the context of the Log Server process.",
"id": "GHSA-pc79-p3cx-hcjp",
"modified": "2025-11-06T18:32:48Z",
"published": "2025-10-31T00:30:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-34277"
},
{
"type": "WEB",
"url": "https://www.nagios.com/changelog/#log-server-2024R1"
},
{
"type": "WEB",
"url": "https://www.nagios.com/products/security/#log-server"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/nagios-log-server-rce-via-malformed-dashboard-id"
}
],
"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"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/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-PC7W-54Q4-2CX9
Vulnerability from github – Published: 2022-05-01 07:01 – Updated: 2022-05-01 07:01PHP remote file inclusion vulnerability in SocketMail Lite and Pro 2.2.6 and earlier, when register_globals and magic_quotes are enabled, allows remote attackers to execute arbitrary PHP code via a URL in the site_path parameter to (1) index.php and (2) inc-common.php.
{
"affected": [],
"aliases": [
"CVE-2006-2681"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-05-31T10:06:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in SocketMail Lite and Pro 2.2.6 and earlier, when register_globals and magic_quotes are enabled, allows remote attackers to execute arbitrary PHP code via a URL in the site_path parameter to (1) index.php and (2) inc-common.php.",
"id": "GHSA-pc7w-54q4-2cx9",
"modified": "2022-05-01T07:01:23Z",
"published": "2022-05-01T07:01:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-2681"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/26693"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/20273"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1016228"
},
{
"type": "WEB",
"url": "http://www.majorsecurity.de/advisory/major_rls6.txt"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/1976"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PC7W-VV76-8CV4
Vulnerability from github – Published: 2022-05-05 02:48 – Updated: 2022-05-05 02:48The smart proxy Puppet run API in Foreman before 1.2.0 allows remote attackers to execute arbitrary commands via vectors related to escaping and Puppet commands.
{
"affected": [],
"aliases": [
"CVE-2013-0210"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-05-08T14:29:00Z",
"severity": "HIGH"
},
"details": "The smart proxy Puppet run API in Foreman before 1.2.0 allows remote attackers to execute arbitrary commands via vectors related to escaping and Puppet commands.",
"id": "GHSA-pc7w-vv76-8cv4",
"modified": "2022-05-05T02:48:35Z",
"published": "2022-05-05T02:48:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-0210"
},
{
"type": "WEB",
"url": "http://theforeman.org/security.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PC82-H94J-GHV6
Vulnerability from github – Published: 2022-05-17 00:46 – Updated: 2022-05-17 00:46PHP remote file inclusion vulnerability in cms/classes/openengine/filepool.php in openEngine 2.0 beta2, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the oe_classpath parameter, a different vector than CVE-2008-4329.
{
"affected": [],
"aliases": [
"CVE-2008-4719"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-10-23T20:00:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in cms/classes/openengine/filepool.php in openEngine 2.0 beta2, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the oe_classpath parameter, a different vector than CVE-2008-4329.",
"id": "GHSA-pc82-h94j-ghv6",
"modified": "2022-05-17T00:46:42Z",
"published": "2022-05-17T00:46:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4719"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45482"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/6585"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/4478"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/31423"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-PC8H-5QFP-98RQ
Vulnerability from github – Published: 2022-05-14 01:53 – Updated: 2022-05-14 01:53MiniCMS 1.10 allows execution of arbitrary PHP code via the install.php sitename parameter, which affects the site_name field in mc_conf.php.
{
"affected": [],
"aliases": [
"CVE-2018-18892"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-11-01T01:29:00Z",
"severity": "CRITICAL"
},
"details": "MiniCMS 1.10 allows execution of arbitrary PHP code via the install.php sitename parameter, which affects the site_name field in mc_conf.php.",
"id": "GHSA-pc8h-5qfp-98rq",
"modified": "2022-05-14T01:53:44Z",
"published": "2022-05-14T01:53:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-18892"
},
{
"type": "WEB",
"url": "https://github.com/AvaterXXX/MiniCms/blob/master/Command%20Execution.md"
},
{
"type": "WEB",
"url": "https://www.patec.cn/newsshow.php?cid=24\u0026id=135"
}
],
"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"
}
]
}
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.