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.
8285 vulnerabilities reference this CWE, most recent first.
GHSA-F594-4W5V-RPF5
Vulnerability from github – Published: 2022-11-16 12:00 – Updated: 2024-07-03 18:32LimeSurvey v5.4.4 was discovered to contain a SQL injection vulnerability via the component /application/views/themeOptions/update.php.
{
"affected": [],
"aliases": [
"CVE-2022-43279"
],
"database_specific": {
"cwe_ids": [
"CWE-89",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-11-15T21:15:00Z",
"severity": "HIGH"
},
"details": "LimeSurvey v5.4.4 was discovered to contain a SQL injection vulnerability via the component /application/views/themeOptions/update.php.",
"id": "GHSA-f594-4w5v-rpf5",
"modified": "2024-07-03T18:32:47Z",
"published": "2022-11-16T12:00:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-43279"
},
{
"type": "WEB",
"url": "https://github.com/LimeSurvey/LimeSurvey/commit/42920389f99cdd25449eb7ace57f24417e83b692"
},
{
"type": "WEB",
"url": "https://brick-pamphlet-d24.notion.site/LimeSurvey-V5-4-4-background-update-php-SQL-injection-50e8fd6eba4644bb941b2c8d6fb7979a"
}
],
"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-F594-W3VJ-GF5C
Vulnerability from github – Published: 2022-05-02 03:18 – Updated: 2022-05-02 03:18Multiple CRLF injection vulnerabilities in webadmin in ZNC before 0.066 allow remote authenticated users to modify the znc.conf configuration file and gain privileges via CRLF sequences in the quit message and other vectors.
{
"affected": [],
"aliases": [
"CVE-2009-0759"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-03-03T16:30:00Z",
"severity": "MODERATE"
},
"details": "Multiple CRLF injection vulnerabilities in webadmin in ZNC before 0.066 allow remote authenticated users to modify the znc.conf configuration file and gain privileges via CRLF sequences in the quit message and other vectors.",
"id": "GHSA-f594-w3vj-gf5c",
"modified": "2022-05-02T03:18:09Z",
"published": "2022-05-02T03:18:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-0759"
},
{
"type": "WEB",
"url": "http://osvdb.org/52295"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/34230"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2009/dsa-1735"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2009/03/01/2"
},
{
"type": "WEB",
"url": "http://znc.svn.sourceforge.net/viewvc/znc/trunk/modules/webadmin.cpp?view=log\u0026sortby=rev\u0026sortdir=down\u0026pathrev=1395"
},
{
"type": "WEB",
"url": "http://znc.svn.sourceforge.net/viewvc/znc?view=rev\u0026sortby=rev\u0026sortdir=down\u0026revision=1395"
},
{
"type": "WEB",
"url": "http://znc.svn.sourceforge.net/viewvc/znc?view=rev\u0026sortby=rev\u0026sortdir=down\u0026revision=1396"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F595-6HWF-PV87
Vulnerability from github – Published: 2022-05-14 02:36 – Updated: 2022-05-14 02:36pubconv.dll (aka the Publisher Converter DLL) in Microsoft Publisher 2002 SP3 does not properly perform array indexing, which allows remote attackers to execute arbitrary code via a crafted Publisher file that uses an old file format, aka "Array Indexing Memory Corruption Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2010-3955"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-12-16T19:33:00Z",
"severity": "HIGH"
},
"details": "pubconv.dll (aka the Publisher Converter DLL) in Microsoft Publisher 2002 SP3 does not properly perform array indexing, which allows remote attackers to execute arbitrary code via a crafted Publisher file that uses an old file format, aka \"Array Indexing Memory Corruption Vulnerability.\"",
"id": "GHSA-f595-6hwf-pv87",
"modified": "2022-05-14T02:36:16Z",
"published": "2022-05-14T02:36:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-3955"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-103"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A12277"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1024885"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA10-348A.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F5C2-2X4V-3CCP
Vulnerability from github – Published: 2022-05-02 03:26 – Updated: 2022-05-02 03:26Unspecified vulnerability in Avifil32.dll in the Windows Media file handling functionality in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP2, Vista Gold, SP1, and SP2, and Server 2008 Gold and SP2 allows remote attackers to execute arbitrary code via a malformed header in a crafted AVI file, aka "Malformed AVI Header Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2009-1545"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-08-12T17:30:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in Avifil32.dll in the Windows Media file handling functionality in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP2, Vista Gold, SP1, and SP2, and Server 2008 Gold and SP2 allows remote attackers to execute arbitrary code via a malformed header in a crafted AVI file, aka \"Malformed AVI Header Vulnerability.\"",
"id": "GHSA-f5c2-2x4v-3ccp",
"modified": "2022-05-02T03:26:10Z",
"published": "2022-05-02T03:26:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-1545"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2009/ms09-038"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A5412"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36206"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/35967"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1022711"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA09-223A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/2233"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F5F8-HV26-RGX9
Vulnerability from github – Published: 2022-05-02 06:15 – Updated: 2022-05-02 06:15Stack-based buffer overflow in Microsoft Office Excel 2002 SP3, Office 2004 for Mac, Office 2008 for Mac, and Open XML File Format Converter for Mac allows remote attackers to execute arbitrary code via an Excel file with a crafted OBJ (0x5D) record, aka "Excel Object Stack Overflow Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2010-0822"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-06-08T20:30:00Z",
"severity": "HIGH"
},
"details": "Stack-based buffer overflow in Microsoft Office Excel 2002 SP3, Office 2004 for Mac, Office 2008 for Mac, and Open XML File Format Converter for Mac allows remote attackers to execute arbitrary code via an Excel file with a crafted OBJ (0x5D) record, aka \"Excel Object Stack Overflow Vulnerability.\"",
"id": "GHSA-f5f8-hv26-rgx9",
"modified": "2022-05-02T06:15:55Z",
"published": "2022-05-02T06:15:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-0822"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-038"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7265"
},
{
"type": "WEB",
"url": "http://osvdb.org/65236"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/511752/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/40520"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA10-159B.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F5QR-VMVH-C85P
Vulnerability from github – Published: 2022-05-17 05:26 – Updated: 2025-04-11 04:00Opera before 12.01 on Windows and UNIX, and before 11.66 and 12.x before 12.01 on Mac OS X, allows user-assisted remote attackers to trick users into downloading and executing arbitrary files via a small window for the download dialog, a different vulnerability than CVE-2012-1924.
{
"affected": [],
"aliases": [
"CVE-2012-4143"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-08-06T16:55:00Z",
"severity": "MODERATE"
},
"details": "Opera before 12.01 on Windows and UNIX, and before 11.66 and 12.x before 12.01 on Mac OS X, allows user-assisted remote attackers to trick users into downloading and executing arbitrary files via a small window for the download dialog, a different vulnerability than CVE-2012-1924.",
"id": "GHSA-f5qr-vmvh-c85p",
"modified": "2025-04-11T04:00:16Z",
"published": "2022-05-17T05:26:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-4143"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/mac/1166"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/mac/1201"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/unix/1201"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/windows/1201"
},
{
"type": "WEB",
"url": "http://www.opera.com/support/kb/view/1027"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F5RR-G89R-MHG4
Vulnerability from github – Published: 2022-05-01 18:30 – Updated: 2022-05-01 18:30PHP remote file inclusion vulnerability in show.php in David Watters Helplink 0.1.0 allows remote attackers to execute arbitrary PHP code via a URL in the file parameter.
{
"affected": [],
"aliases": [
"CVE-2007-5099"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-09-26T22:17:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in show.php in David Watters Helplink 0.1.0 allows remote attackers to execute arbitrary PHP code via a URL in the file parameter.",
"id": "GHSA-f5rr-g89r-mhg4",
"modified": "2022-05-01T18:30:12Z",
"published": "2022-05-01T18:30:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5099"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4448"
},
{
"type": "WEB",
"url": "http://osvdb.org/37225"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26910"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25782"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/3253"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F5VG-HJ9X-R48M
Vulnerability from github – Published: 2022-05-17 01:12 – Updated: 2022-05-17 01:12lib/message.php in X7 Chat 2.0.0 through 2.0.5.1 allows remote authenticated users to execute arbitrary PHP code via a crafted HTTP header to index.php, which is processed by the preg_replace function with the eval switch.
{
"affected": [],
"aliases": [
"CVE-2014-8998"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-11-20T13:55:00Z",
"severity": "MODERATE"
},
"details": "lib/message.php in X7 Chat 2.0.0 through 2.0.5.1 allows remote authenticated users to execute arbitrary PHP code via a crafted HTTP header to index.php, which is processed by the preg_replace function with the eval switch.",
"id": "GHSA-f5vg-hj9x-r48m",
"modified": "2022-05-17T01:12:26Z",
"published": "2022-05-17T01:12:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-8998"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/98513"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/128964/X7-Chat-2.0.5-lib-message.php-preg_replace-PHP-Code-Execution.html"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/35183"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/71014"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-F5VV-HCGF-XVXQ
Vulnerability from github – Published: 2023-06-29 15:30 – Updated: 2024-04-04 05:17Orthanc before 1.12.0 allows authenticated users with access to the Orthanc API to overwrite arbitrary files on the file system, and in specific deployment scenarios allows the attacker to overwrite the configuration, which can be exploited to trigger Remote Code Execution (RCE).
{
"affected": [],
"aliases": [
"CVE-2023-33466"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-06-29T15:15:09Z",
"severity": "HIGH"
},
"details": "Orthanc before 1.12.0 allows authenticated users with access to the Orthanc API to overwrite arbitrary files on the file system, and in specific deployment scenarios allows the attacker to overwrite the configuration, which can be exploited to trigger Remote Code Execution (RCE).",
"id": "GHSA-f5vv-hcgf-xvxq",
"modified": "2024-04-04T05:17:29Z",
"published": "2023-06-29T15:30:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-33466"
},
{
"type": "WEB",
"url": "https://discourse.orthanc-server.org/t/security-advisory-for-orthanc-deployments-running-versions-before-1-12-0/3568"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2023/09/msg00009.html"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2023/dsa-5473"
}
],
"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-F5W9-Q8FJ-H9JJ
Vulnerability from github – Published: 2023-10-26 18:30 – Updated: 2024-04-04 08:56NNM failed to properly set ACLs on its installation directory, which could allow a low privileged user to run arbitrary code with SYSTEM privileges where NNM is installed to a non-standard location
{
"affected": [],
"aliases": [
"CVE-2023-5623"
],
"database_specific": {
"cwe_ids": [
"CWE-276",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-10-26T17:15:09Z",
"severity": "HIGH"
},
"details": "\nNNM failed to properly set ACLs on its installation directory, which could allow a low privileged user to run arbitrary code with SYSTEM privileges where NNM is installed to a non-standard location\n\n",
"id": "GHSA-f5w9-q8fj-h9jj",
"modified": "2024-04-04T08:56:54Z",
"published": "2023-10-26T18:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-5623"
},
{
"type": "WEB",
"url": "https://www.tenable.com/security/tns-2023-34"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:H/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.