CWE-94
Allowed-with-ReviewImproper Control of Generation of Code ('Code Injection')
Abstraction: Base · Status: Draft
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
8272 vulnerabilities reference this CWE, most recent first.
GHSA-JC4P-RHVC-XG67
Vulnerability from github – Published: 2024-04-11 21:30 – Updated: 2024-07-03 18:34Server Side Template Injection (SSTI) vulnerability in Form Tools 3.1.1 allows attackers to run arbitrary commands via the Group Name field under the add forms section of the application.
{
"affected": [],
"aliases": [
"CVE-2024-22722"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-11T20:15:33Z",
"severity": "HIGH"
},
"details": "Server Side Template Injection (SSTI) vulnerability in Form Tools 3.1.1 allows attackers to run arbitrary commands via the Group Name field under the add forms section of the application.",
"id": "GHSA-jc4p-rhvc-xg67",
"modified": "2024-07-03T18:34:18Z",
"published": "2024-04-11T21:30:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-22722"
},
{
"type": "WEB",
"url": "https://hakaisecurity.io/error-404-your-security-not-found-tales-of-web-vulnerabilities"
}
],
"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-JC6G-GFGQ-7CJ3
Vulnerability from github – Published: 2022-05-17 04:45 – Updated: 2022-05-17 04:45Cisco TelePresence TC Software 4.x and 5.x before 5.1.7 and 6.x before 6.0.1 and TE Software 4.x and 6.0 allow remote authenticated users to execute arbitrary commands by using the commands as arguments to tshell (aka tcsh) scripts, aka Bug ID CSCue60202.
{
"affected": [],
"aliases": [
"CVE-2014-2170"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-05-02T10:55:00Z",
"severity": "HIGH"
},
"details": "Cisco TelePresence TC Software 4.x and 5.x before 5.1.7 and 6.x before 6.0.1 and TE Software 4.x and 6.0 allow remote authenticated users to execute arbitrary commands by using the commands as arguments to tshell (aka tcsh) scripts, aka Bug ID CSCue60202.",
"id": "GHSA-jc6g-gfgq-7cj3",
"modified": "2022-05-17T04:45:12Z",
"published": "2022-05-17T04:45:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-2170"
},
{
"type": "WEB",
"url": "http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20140430-tcte"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-JC7H-WRG4-22RV
Vulnerability from github – Published: 2022-05-01 07:26 – Updated: 2022-05-01 07:26Multiple PHP remote file inclusion vulnerabilities in WebYep 1.1.9, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via the webyep_sIncludePath in (1) files in the programm/lib/ directory including (a) WYApplication.php, (b) WYDocument.php, (c) WYEditor.php, (d) WYElement.php, (e) WYFile.php, (f) WYHTMLTag.php, (g) WYImage.php, (h) WYLanguage.php, (i) WYLink.php, (j) WYPath.php, (k) WYPopupWindowLink.php, (l) WYSelectMenu.php, and (m) WYTextArea.php; (2) files in the programm/elements/ directory including (n) WYGalleryElement.php, (o) WYGuestbookElement.php, (p) WYImageElement.php, (q) WYLogonButtonElement.php, (r) WYLongTextElement.php, (s) WYLoopElement.php, (t) WYMenuElement.php, and (u) WYShortTextElement.php; and (3) programm/webyep.php.
{
"affected": [],
"aliases": [
"CVE-2006-5220"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-10-10T04:06:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in WebYep 1.1.9, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via the webyep_sIncludePath in (1) files in the programm/lib/ directory including (a) WYApplication.php, (b) WYDocument.php, (c) WYEditor.php, (d) WYElement.php, (e) WYFile.php, (f) WYHTMLTag.php, (g) WYImage.php, (h) WYLanguage.php, (i) WYLink.php, (j) WYPath.php, (k) WYPopupWindowLink.php, (l) WYSelectMenu.php, and (m) WYTextArea.php; (2) files in the programm/elements/ directory including (n) WYGalleryElement.php, (o) WYGuestbookElement.php, (p) WYImageElement.php, (q) WYLogonButtonElement.php, (r) WYLongTextElement.php, (s) WYLoopElement.php, (t) WYMenuElement.php, and (u) WYShortTextElement.php; and (3) programm/webyep.php.",
"id": "GHSA-jc7h-wrg4-22rv",
"modified": "2022-05-01T07:26:16Z",
"published": "2022-05-01T07:26:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-5220"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/29397"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/2496"
},
{
"type": "WEB",
"url": "http://advisories.echo.or.id/adv/adv48-theday-2006.txt"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/22336"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/1702"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1017023"
},
{
"type": "WEB",
"url": "http://www.obdev.at/products/webyep/release-notes.html"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29643"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29644"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29645"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29646"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29647"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29648"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29649"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29650"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29651"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29652"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29653"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29654"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29655"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29656"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29657"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29658"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29659"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29660"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29661"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29662"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/29663"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/448009/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/20406"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/3972"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-JC85-FPWF-QM7X
Vulnerability from github – Published: 2025-11-05 03:30 – Updated: 2025-12-09 15:33The expr-eval library is a JavaScript expression parser and evaluator designed to safely evaluate mathematical expressions with user-defined variables. However, due to insufficient input validation, an attacker can pass a crafted variables object into the evaluate() function and trigger arbitrary code execution.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "expr-eval"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "2.0.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.0.0"
},
"package": {
"ecosystem": "npm",
"name": "expr-eval-fork"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-12735"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-11-05T18:46:50Z",
"nvd_published_at": "2025-11-05T01:15:33Z",
"severity": "HIGH"
},
"details": "The expr-eval library is a JavaScript expression parser and evaluator designed to safely evaluate mathematical expressions with user-defined variables. However, due to insufficient input validation, an attacker can pass a crafted variables object into the evaluate() function and trigger arbitrary code execution.",
"id": "GHSA-jc85-fpwf-qm7x",
"modified": "2025-12-09T15:33:15Z",
"published": "2025-11-05T03:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-12735"
},
{
"type": "WEB",
"url": "https://github.com/silentmatt/expr-eval/pull/288"
},
{
"type": "WEB",
"url": "https://github.com/silentmatt/expr-eval/pull/289"
},
{
"type": "WEB",
"url": "https://github.com/jorenbroekema/expr-eval/commit/1d71bb2ca8f98df8de00e9cc4de8fdd468a7ad43"
},
{
"type": "WEB",
"url": "https://github.com/jorenbroekema/expr-eval"
},
{
"type": "WEB",
"url": "https://github.com/jorenbroekema/expr-eval/blob/460b820ba01c5aca6c5d84a7d4f1fa5d1913c67b/test/security.js"
},
{
"type": "WEB",
"url": "https://github.com/silentmatt/expr-eval"
},
{
"type": "WEB",
"url": "https://kb.cert.org/vuls/id/263614"
},
{
"type": "WEB",
"url": "https://www.kb.cert.org/vuls/id/263614"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/package/expr-eval"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/package/expr-eval-fork"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "expr-eval does not restrict functions passed to the evaluate function"
}
GHSA-JCCX-M9V4-9HWH
Vulnerability from github – Published: 2025-03-20 12:32 – Updated: 2025-03-21 22:23A remote code execution vulnerability exists in the Calculate function of parisneo/lollms version 9.8. The vulnerability arises from the use of Python's eval() function to evaluate mathematical expressions within a Python sandbox that disables __builtins__ and only allows functions from the math module. This sandbox can be bypassed by loading the os module using the _frozen_importlib.BuiltinImporter class, allowing an attacker to execute arbitrary commands on the server. The issue is fixed in version 9.10.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "lollms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "11.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-6982"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-03-21T22:23:35Z",
"nvd_published_at": "2025-03-20T10:15:34Z",
"severity": "HIGH"
},
"details": "A remote code execution vulnerability exists in the Calculate function of parisneo/lollms version 9.8. The vulnerability arises from the use of Python\u0027s `eval()` function to evaluate mathematical expressions within a Python sandbox that disables `__builtins__` and only allows functions from the `math` module. This sandbox can be bypassed by loading the `os` module using the `_frozen_importlib.BuiltinImporter` class, allowing an attacker to execute arbitrary commands on the server. The issue is fixed in version 9.10.",
"id": "GHSA-jccx-m9v4-9hwh",
"modified": "2025-03-21T22:23:35Z",
"published": "2025-03-20T12:32:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6982"
},
{
"type": "WEB",
"url": "https://github.com/parisneo/lollms/commit/30e7eaba2ccfb751a81e7cb29fdef2ae8ffa6832"
},
{
"type": "PACKAGE",
"url": "https://github.com/ParisNeo/lollms"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/4f8e73ac-aaaf-4d5c-a6dd-58215b5a7fea"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "LoLLMS Code Injection vulnerability"
}
GHSA-JCFM-5VRW-VG43
Vulnerability from github – Published: 2022-05-17 00:37 – Updated: 2022-05-17 00:37Static code injection vulnerability in Sanus|artificium (aka Sanusart) Free simple guestbook PHP script, when downloaded before 20081111, allows remote attackers to inject arbitrary PHP code into messages.txt via the message parameter to act.php, which is executed when guestbook/guestbook.php is accessed. NOTE: some of these details are obtained from third party information.
{
"affected": [],
"aliases": [
"CVE-2008-6934"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-08-11T21:00:00Z",
"severity": "HIGH"
},
"details": "Static code injection vulnerability in Sanus|artificium (aka Sanusart) Free simple guestbook PHP script, when downloaded before 20081111, allows remote attackers to inject arbitrary PHP code into messages.txt via the message parameter to act.php, which is executed when guestbook/guestbook.php is accessed. NOTE: some of these details are obtained from third party information.",
"id": "GHSA-jcfm-5vrw-vg43",
"modified": "2022-05-17T00:37:20Z",
"published": "2022-05-17T00:37:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6934"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/46526"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/7079"
},
{
"type": "WEB",
"url": "http://osvdb.org/49703"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32643"
},
{
"type": "WEB",
"url": "http://www.sanusart.com/news.php"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32240"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/3095"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-JCM8-JGJM-3Q85
Vulnerability from github – Published: 2022-05-14 02:43 – Updated: 2022-05-14 02:43The extSetOwner function in the UfProxyBrowserCtrl ActiveX control (UfPBCtrl.dll) in Trend Micro Internet Security Pro 2010 allows remote attackers to execute arbitrary code via an invalid address that is dereferenced as a pointer.
{
"affected": [],
"aliases": [
"CVE-2010-3189"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-08-31T20:00:00Z",
"severity": "HIGH"
},
"details": "The extSetOwner function in the UfProxyBrowserCtrl ActiveX control (UfPBCtrl.dll) in Trend Micro Internet Security Pro 2010 allows remote attackers to execute arbitrary code via an invalid address that is dereferenced as a pointer.",
"id": "GHSA-jcm8-jgjm-3q85",
"modified": "2022-05-14T02:43:37Z",
"published": "2022-05-14T02:43:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-3189"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/61397"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7633"
},
{
"type": "WEB",
"url": "http://esupport.trendmicro.com/pages/Hot-Fix-UfPBCtrldll-is-vulnerable-to-remote-attackers.aspx"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/41140"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/513327/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1024364"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/2185"
},
{
"type": "WEB",
"url": "http://www.zerodayinitiative.com/advisories/ZDI-10-165"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-JCRR-RR6W-8C83
Vulnerability from github – Published: 2023-12-22 12:31 – Updated: 2024-09-12 21:32An issue was discovered in free5GC version 3.3.0, allows remote attackers to execute arbitrary code and cause a denial of service (DoS) on AMF component via crafted NGAP message.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/free5gc/amf"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.2.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-49391"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-12-22T19:51:38Z",
"nvd_published_at": "2023-12-22T11:15:07Z",
"severity": "HIGH"
},
"details": "An issue was discovered in free5GC version 3.3.0, allows remote attackers to execute arbitrary code and cause a denial of service (DoS) on AMF component via crafted NGAP message.",
"id": "GHSA-jcrr-rr6w-8c83",
"modified": "2024-09-12T21:32:39Z",
"published": "2023-12-22T12:31:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-49391"
},
{
"type": "WEB",
"url": "https://github.com/free5gc/free5gc/issues/497"
},
{
"type": "WEB",
"url": "https://github.com/free5gc/amf/commit/6fc612c35997cf4e8be1e5c86ae2242f04b576a9"
},
{
"type": "PACKAGE",
"url": "https://github.com/free5gc/amf"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "free5GC AMF denial of service vulnerability"
}
GHSA-JCW8-R9XM-32C6
Vulnerability from github – Published: 2018-07-18 18:28 – Updated: 2020-08-31 18:26Affected versions of dns-sync have an arbitrary command execution vulnerability in the resolve() method.
Recommendation
- Use an alternative dns resolver
- Do not allow untrusted input into
dns-sync.resolve()
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "dns-sync"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.1.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2017-16100"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:43:08Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "Affected versions of `dns-sync` have an arbitrary command execution vulnerability in the `resolve()` method. \n\n\n\n## Recommendation\n\n- Use an alternative dns resolver\n- Do not allow untrusted input into `dns-sync.resolve()`",
"id": "GHSA-jcw8-r9xm-32c6",
"modified": "2020-08-31T18:26:20Z",
"published": "2018-07-18T18:28:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-16100"
},
{
"type": "WEB",
"url": "https://github.com/skoranga/node-dns-sync/issues/1"
},
{
"type": "WEB",
"url": "https://github.com/skoranga/node-dns-sync/issues/1)"
},
{
"type": "WEB",
"url": "https://github.com/skoranga/node-dns-sync/issues/5"
},
{
"type": "WEB",
"url": "https://github.com/skoranga/node-dns-sync/commit/d9abaae384b198db1095735ad9c1c73d7b890a0d"
},
{
"type": "WEB",
"url": "https://github.com/skoranga/node-dns-sync/commit/d9abaae384b198db1095735ad9c1c73d7b890a0d)))"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-jcw8-r9xm-32c6"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/153"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/523"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Command Injection in dns-sync"
}
GHSA-JF79-6XX8-WW93
Vulnerability from github – Published: 2022-05-13 01:43 – Updated: 2022-05-13 01:43IBM Emptoris Services Procurement 10.0.0.5 could allow a remote attacker to include arbitrary files. A remote attacker could send a specially-crafted URL to specify a malicious file from a remote system, which could allow the attacker to execute arbitrary code on the vulnerable Web server. IBM X-Force ID: 128105.
{
"affected": [],
"aliases": [
"CVE-2017-1440"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-08-30T21:29:00Z",
"severity": "HIGH"
},
"details": "IBM Emptoris Services Procurement 10.0.0.5 could allow a remote attacker to include arbitrary files. A remote attacker could send a specially-crafted URL to specify a malicious file from a remote system, which could allow the attacker to execute arbitrary code on the vulnerable Web server. IBM X-Force ID: 128105.",
"id": "GHSA-jf79-6xx8-ww93",
"modified": "2022-05-13T01:43:24Z",
"published": "2022-05-13T01:43:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-1440"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/128105"
},
{
"type": "WEB",
"url": "http://www-01.ibm.com/support/docview.wss?uid=swg22005550"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/99542"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/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.