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-675P-6MMR-FFFG
Vulnerability from github – Published: 2025-04-28 18:30 – Updated: 2025-04-28 18:30Newforma Project Center Server through 2023.3.0.32259 allows remote code execution because .NET Remoting is exposed.
{
"affected": [],
"aliases": [
"CVE-2024-32499"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-28T17:15:47Z",
"severity": "MODERATE"
},
"details": "Newforma Project Center Server through 2023.3.0.32259 allows remote code execution because .NET Remoting is exposed.",
"id": "GHSA-675p-6mmr-fffg",
"modified": "2025-04-28T18:30:57Z",
"published": "2025-04-28T18:30:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32499"
},
{
"type": "WEB",
"url": "https://code-white.com/public-vulnerability-list"
},
{
"type": "WEB",
"url": "https://www.newforma.com/newforma-project-center"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-675Q-H7HW-82G4
Vulnerability from github – Published: 2024-05-14 18:30 – Updated: 2024-05-14 18:30Vulnerability in WBSAirback 21.02.04, which involves improper neutralisation of Server-Side Includes (SSI), through License (/admin/CDPUsers). Exploitation of this vulnerability could allow a remote user to execute arbitrary code.
{
"affected": [],
"aliases": [
"CVE-2024-3788"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-14T15:42:16Z",
"severity": "MODERATE"
},
"details": "Vulnerability in WBSAirback 21.02.04, which involves improper neutralisation of Server-Side Includes (SSI), through License (/admin/CDPUsers). Exploitation of this vulnerability could allow a remote user to execute arbitrary code.",
"id": "GHSA-675q-h7hw-82g4",
"modified": "2024-05-14T18:30:52Z",
"published": "2024-05-14T18:30:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3788"
},
{
"type": "WEB",
"url": "https://www.incibe.es/en/incibe-cert/notices/aviso/multiple-vulnerabilities-wbsairback-white-bear-solutions"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-676G-GCJX-G33F
Vulnerability from github – Published: 2022-05-17 05:17 – Updated: 2022-05-17 05:17webvrpcs.exe in Advantech/BroadWin WebAccess allows remote attackers to execute arbitrary code or obtain a security-code value via a long string in an RPC request to TCP port 4592.
{
"affected": [],
"aliases": [
"CVE-2011-4041"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-02-06T20:55:00Z",
"severity": "HIGH"
},
"details": "webvrpcs.exe in Advantech/BroadWin WebAccess allows remote attackers to execute arbitrary code or obtain a security-code value via a long string in an RPC request to TCP port 4592.",
"id": "GHSA-676g-gcjx-g33f",
"modified": "2022-05-17T05:17:55Z",
"published": "2022-05-17T05:17:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-4041"
},
{
"type": "WEB",
"url": "http://reversemode.com/index.php?option=com_content\u0026task=view\u0026id=72\u0026Itemid=1"
},
{
"type": "WEB",
"url": "http://www.reversemode.com/downloads/Scada_Trojans_Ruben_Rootedcon.pdf"
},
{
"type": "WEB",
"url": "http://www.reversemode.com/downloads/exploit_advantech.zip"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/517117"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/47008"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/control_systems/pdf/ICS-ALERT-11-081-01.pdf"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/control_systems/pdf/ICSA-11-094-02A.pdf"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-676V-WH57-P375
Vulnerability from github – Published: 2026-04-21 15:32 – Updated: 2026-04-25 23:27In Dolibarr ERP & CRM <= 22.0.4, PHP code detection and editing permission enforcement in the Website module is not applied consistently to all input parameters, allowing an authenticated user restricted to HTML/JavaScript editing to inject PHP code through unprotected inputs during website page creation.
A patch is available at https://github.com/Dolibarr/dolibarr/releases/tag/23.0.0.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "dolibarr/dolibarr"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "15.0.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-31018"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-25T23:27:10Z",
"nvd_published_at": "2026-04-21T15:16:36Z",
"severity": "HIGH"
},
"details": "In Dolibarr ERP \u0026 CRM \u003c= 22.0.4, PHP code detection and editing permission enforcement in the Website module is not applied consistently to all input parameters, allowing an authenticated user restricted to HTML/JavaScript editing to inject PHP code through unprotected inputs during website page creation.\n\nA patch is available at https://github.com/Dolibarr/dolibarr/releases/tag/23.0.0.",
"id": "GHSA-676v-wh57-p375",
"modified": "2026-04-25T23:27:10Z",
"published": "2026-04-21T15:32:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31018"
},
{
"type": "WEB",
"url": "https://github.com/Dolibarr/dolibarr/commit/ba28d16da4cc0c221f49a878fecc8425501ceb96"
},
{
"type": "PACKAGE",
"url": "https://github.com/Dolibarr/dolibarr"
},
{
"type": "WEB",
"url": "https://github.com/Dolibarr/dolibarr/releases/tag/23.0.0"
},
{
"type": "WEB",
"url": "https://github.com/PhDg1410/CVE/blob/main/CVE-2026-31018/README.md"
},
{
"type": "WEB",
"url": "http://dolibarr.com"
}
],
"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"
}
],
"summary": "Dolibarr Allows Code Injection through its Website Module"
}
GHSA-6773-RFJV-C54W
Vulnerability from github – Published: 2023-09-20 03:30 – Updated: 2024-09-25 19:21An issue in Dolibarr ERP CRM v.17.0.1 and before allows a remote privileged attacker to execute arbitrary code via a crafted command/script.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "dolibarr/dolibarr"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "17.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-38886"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-09-21T17:03:31Z",
"nvd_published_at": "2023-09-20T01:15:56Z",
"severity": "HIGH"
},
"details": "An issue in Dolibarr ERP CRM v.17.0.1 and before allows a remote privileged attacker to execute arbitrary code via a crafted command/script.",
"id": "GHSA-6773-rfjv-c54w",
"modified": "2024-09-25T19:21:16Z",
"published": "2023-09-20T03:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-38886"
},
{
"type": "WEB",
"url": "https://akerva.com/wp-content/uploads/2023/09/AKERVA_Security-Advisory_CVE-2023-38886_Dolibarr_RCE-1.pdf"
},
{
"type": "PACKAGE",
"url": "https://github.com/Dolibarr/dolibarr"
},
{
"type": "WEB",
"url": "http://dolibarr.com"
}
],
"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"
}
],
"summary": "Dolibarr allows a remote privileged attacker to execute arbitrary code via a crafted command/script"
}
GHSA-678R-9FW4-2W76
Vulnerability from github – Published: 2022-05-02 03:37 – Updated: 2022-05-02 03:37The VMnc media codec in vmnc.dll in VMware Movie Decoder before 6.5.3 build 185404, VMware Workstation 6.5.x before 6.5.3 build 185404, VMware Player 2.5.x before 2.5.3 build 185404, and VMware ACE 2.5.x before 2.5.3 build 185404 on Windows does not properly handle certain small heights in video content, which might allow remote attackers to execute arbitrary code via a crafted AVI file that triggers heap memory corruption.
{
"affected": [],
"aliases": [
"CVE-2009-2628"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-09-08T22:30:00Z",
"severity": "HIGH"
},
"details": "The VMnc media codec in vmnc.dll in VMware Movie Decoder before 6.5.3 build 185404, VMware Workstation 6.5.x before 6.5.3 build 185404, VMware Player 2.5.x before 2.5.3 build 185404, and VMware ACE 2.5.x before 2.5.3 build 185404 on Windows does not properly handle certain small heights in video content, which might allow remote attackers to execute arbitrary code via a crafted AVI file that triggers heap memory corruption.",
"id": "GHSA-678r-9fw4-2w76",
"modified": "2022-05-02T03:37:07Z",
"published": "2022-05-02T03:37:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2628"
},
{
"type": "WEB",
"url": "http://lists.vmware.com/pipermail/security-announce/2009/000065.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34938"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/444513"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/506286/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/36290"
},
{
"type": "WEB",
"url": "http://www.vmware.com/security/advisories/VMSA-2009-0012.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/2553"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-67H2-MPM8-HMXF
Vulnerability from github – Published: 2022-05-17 02:38 – Updated: 2025-04-12 12:42The setup_group function in bfd/elf.c in libbfd in GNU binutils 2.24 and earlier allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via crafted section group headers in an ELF file.
{
"affected": [],
"aliases": [
"CVE-2014-8485"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-12-09T23:59:00Z",
"severity": "HIGH"
},
"details": "The setup_group function in bfd/elf.c in libbfd in GNU binutils 2.24 and earlier allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via crafted section group headers in an ELF file.",
"id": "GHSA-67h2-mpm8-hmxf",
"modified": "2025-04-12T12:42:43Z",
"published": "2022-05-17T02:38:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-8485"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1157276"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/201612-24"
},
{
"type": "WEB",
"url": "https://sourceware.org/bugzilla/show_bug.cgi?id=17510"
},
{
"type": "WEB",
"url": "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git%3Ba=commit%3Bh=493a33860c71cac998f1a56d6d87d6faa801fbaa"
},
{
"type": "WEB",
"url": "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=493a33860c71cac998f1a56d6d87d6faa801fbaa"
},
{
"type": "WEB",
"url": "http://lcamtuf.blogspot.co.uk/2014/10/psa-dont-run-strings-on-untrusted-files.html"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2014-December/145262.html"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2014-December/145328.html"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2014-December/145742.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/62241"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/62746"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2015:029"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2014/10/26/2"
},
{
"type": "WEB",
"url": "http://www.oracle.com/technetwork/topics/security/linuxbulletinoct2015-2719645.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/70741"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/USN-2496-1"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-67HG-2G8M-4JM2
Vulnerability from github – Published: 2024-06-29 06:31 – Updated: 2024-06-29 06:31In Helix ALM versions prior to 2024.2.0, a local command injection was identified. Reported by Bryan Riggins.
{
"affected": [],
"aliases": [
"CVE-2024-3995"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-06-28T20:15:02Z",
"severity": "LOW"
},
"details": "In Helix ALM versions prior to 2024.2.0, a local command injection was identified. Reported by Bryan Riggins.",
"id": "GHSA-67hg-2g8m-4jm2",
"modified": "2024-06-29T06:31:40Z",
"published": "2024-06-29T06:31:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3995"
},
{
"type": "WEB",
"url": "https://portal.perforce.com/s/detail/a91PA000001SU5pYAG"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/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-67QP-3X3R-RX23
Vulnerability from github – Published: 2022-05-02 03:29 – Updated: 2022-05-02 03:29Mozilla Firefox before 3.0.11, Thunderbird before 2.0.0.22, and SeaMonkey before 1.1.17 allow remote attackers to cause a denial of service (memory corruption and application crash) or possibly execute arbitrary code via vectors involving "double frame construction."
{
"affected": [],
"aliases": [
"CVE-2009-1832"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-06-12T21:30:00Z",
"severity": "HIGH"
},
"details": "Mozilla Firefox before 3.0.11, Thunderbird before 2.0.0.22, and SeaMonkey before 1.1.17 allow remote attackers to cause a denial of service (memory corruption and application crash) or possibly execute arbitrary code via vectors involving \"double frame construction.\"",
"id": "GHSA-67qp-3x3r-rx23",
"modified": "2022-05-02T03:29:06Z",
"published": "2022-05-02T03:29:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-1832"
},
{
"type": "WEB",
"url": "https://bugzilla.mozilla.org/show_bug.cgi?id=484031"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=503569"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10237"
},
{
"type": "WEB",
"url": "https://rhn.redhat.com/errata/RHSA-2009-1095.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-July/msg00444.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-July/msg00504.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-June/msg00574.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2009-June/msg00657.html"
},
{
"type": "WEB",
"url": "http://osvdb.org/55148"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35331"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35415"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35431"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35439"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35440"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35468"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35561"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35602"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35882"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1022376"
},
{
"type": "WEB",
"url": "http://slackware.com/security/viewer.php?l=slackware-security\u0026y=2009\u0026m=slackware-security.372468"
},
{
"type": "WEB",
"url": "http://slackware.com/security/viewer.php?l=slackware-security\u0026y=2009\u0026m=slackware-security.425408"
},
{
"type": "WEB",
"url": "http://sunsolve.sun.com/search/document.do?assetkey=1-26-265068-1"
},
{
"type": "WEB",
"url": "http://sunsolve.sun.com/search/document.do?assetkey=1-77-1020800.1-1"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2009/dsa-1820"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2009/dsa-1830"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2009:141"
},
{
"type": "WEB",
"url": "http://www.mozilla.org/security/announce/2009/mfsa2009-24.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/35326"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/35371"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1022397"
},
{
"type": "WEB",
"url": "http://www.slackware.com/security/viewer.php?l=slackware-security\u0026y=2009\u0026m=slackware-security.454275"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/1572"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/2152"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-67WG-6J7R-MQH8
Vulnerability from github – Published: 2024-06-05 15:07 – Updated: 2024-06-05 15:07Due to a missing file extension in the fileDenyPattern, backend user are allowed to upload *.pht files which can be executed in certain web server setups. The new default fileDenyPattern is the following, which might have been overridden in the TYPO3 Install Tool.
\.(php[3-7]?|phpsh|phtml|pht)(\..*)?$|^\.htaccess$
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "typo3/cms"
},
"ranges": [
{
"events": [
{
"introduced": "7.6.0"
},
{
"fixed": "7.6.22"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "typo3/cms"
},
"ranges": [
{
"events": [
{
"introduced": "8.0.0"
},
{
"fixed": "8.7.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-06-05T15:07:09Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "Due to a missing file extension in the fileDenyPattern, backend user are allowed to upload *.pht files which can be executed in certain web server setups. The new default fileDenyPattern is the following, which might have been overridden in the TYPO3 Install Tool.\n```\n\\.(php[3-7]?|phpsh|phtml|pht)(\\..*)?$|^\\.htaccess$\n```",
"id": "GHSA-67wg-6j7r-mqh8",
"modified": "2024-06-05T15:07:09Z",
"published": "2024-06-05T15:07:09Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/typo3/cms/2017-09-05-4.yaml"
},
{
"type": "PACKAGE",
"url": "https://github.com/TYPO3/typo3"
},
{
"type": "WEB",
"url": "https://typo3.org/security/advisory/typo3-core-sa-2017-007"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Arbitrary Code Execution in TYPO3 CMS"
}
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.