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.
8358 vulnerabilities reference this CWE, most recent first.
GHSA-45W8-9RCX-PC99
Vulnerability from github – Published: 2022-05-02 03:57 – Updated: 2022-05-02 03:57PHP remote file inclusion vulnerability in home.php in Top Paidmailer allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.
{
"affected": [],
"aliases": [
"CVE-2009-4750"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-03-26T20:30:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in home.php in Top Paidmailer allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.",
"id": "GHSA-45w8-9rcx-pc99",
"modified": "2022-05-02T03:57:51Z",
"published": "2022-05-02T03:57:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4750"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/51661"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/35723"
},
{
"type": "WEB",
"url": "http://www.osvdb.org/55797"
},
{
"type": "WEB",
"url": "http://www.packetstormsecurity.org/0907-exploits/toppaidmailer-rfi.txt"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-45WQ-4GR8-55X9
Vulnerability from github – Published: 2022-05-17 04:58 – Updated: 2022-05-17 04:58McAfee Email Gateway (MEG) 7.0 before 7.0.4 and 7.5 before 7.5.1 allows remote authenticated users to execute arbitrary commands via unspecified vectors.
{
"affected": [],
"aliases": [
"CVE-2013-6349"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2013-11-02T21:55:00Z",
"severity": "HIGH"
},
"details": "McAfee Email Gateway (MEG) 7.0 before 7.0.4 and 7.5 before 7.5.1 allows remote authenticated users to execute arbitrary commands via unspecified vectors.",
"id": "GHSA-45wq-4gr8-55x9",
"modified": "2022-05-17T04:58:35Z",
"published": "2022-05-17T04:58:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-6349"
},
{
"type": "WEB",
"url": "https://kc.mcafee.com/corporate/index?page=content\u0026id=SB10057"
},
{
"type": "WEB",
"url": "http://osvdb.org/98669"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-45XG-5PV3-XX9X
Vulnerability from github – Published: 2023-09-28 03:30 – Updated: 2024-04-04 07:56An issue in phpkobo AjaxNewsTicker v.1.0.5 allows a remote attacker to execute arbitrary code via a crafted payload to the reque parameter.
{
"affected": [],
"aliases": [
"CVE-2023-41450"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-09-28T03:15:11Z",
"severity": "HIGH"
},
"details": "An issue in phpkobo AjaxNewsTicker v.1.0.5 allows a remote attacker to execute arbitrary code via a crafted payload to the reque parameter.",
"id": "GHSA-45xg-5pv3-xx9x",
"modified": "2024-04-04T07:56:32Z",
"published": "2023-09-28T03:30:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-41450"
},
{
"type": "WEB",
"url": "https://gist.github.com/RNPG/e11af10e1bd3606de8b568033d932589"
},
{
"type": "WEB",
"url": "http://ajaxnewsticker.com"
},
{
"type": "WEB",
"url": "http://phpkobo.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-4636-9QMJ-WC6J
Vulnerability from github – Published: 2025-01-10 21:31 – Updated: 2025-01-14 00:30MonicaHQ v4.1.1 was discovered to contain an authenticated Client-Side Injection vulnerability via the entry text field at /journal/entries/ID/edit.
{
"affected": [],
"aliases": [
"CVE-2024-54997"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-10T21:15:13Z",
"severity": "MODERATE"
},
"details": "MonicaHQ v4.1.1 was discovered to contain an authenticated Client-Side Injection vulnerability via the entry text field at /journal/entries/ID/edit.",
"id": "GHSA-4636-9qmj-wc6j",
"modified": "2025-01-14T00:30:45Z",
"published": "2025-01-10T21:31:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-54997"
},
{
"type": "WEB",
"url": "https://github.com/p314dO/CVEs/tree/main/CVE-2024-54997"
},
{
"type": "WEB",
"url": "http://monicahq.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-463R-M79G-7HV3
Vulnerability from github – Published: 2022-05-17 00:39 – Updated: 2022-05-17 00:39PHP remote file inclusion vulnerability in hu/modules/reg-new/modstart.php in Sofi WebGui 0.6.3 PRE and earlier allows remote attackers to execute arbitrary PHP code via a URL in the mod_dir parameter.
{
"affected": [],
"aliases": [
"CVE-2008-6402"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-03-06T11:30:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in hu/modules/reg-new/modstart.php in Sofi WebGui 0.6.3 PRE and earlier allows remote attackers to execute arbitrary PHP code via a URL in the mod_dir parameter.",
"id": "GHSA-463r-m79g-7hv3",
"modified": "2022-05-17T00:39:55Z",
"published": "2022-05-17T00:39:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6402"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45380"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/6539"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/31341"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-465V-95QW-94V6
Vulnerability from github – Published: 2022-05-01 18:44 – Updated: 2022-05-01 18:44Multiple direct static code injection vulnerabilities in RunCMS before 1.6.1 allow remote authenticated administrators to inject arbitrary PHP code via the (1) header and (2) footer parameters to modules/system/admin.php in a meta-generator action, (3) the disclaimer parameter to modules/system/admin.php in a disclaimer action, (4) the disclaimer parameter to modules/mydownloads/admin/index.php in a mydownloadsConfigAdmin action, (5) the disclaimer parameter to modules/newbb_plus/admin/forum_config.php, (6) the disclaimer parameter to modules/mylinks/admin/index.php in a myLinksConfigAdmin action, or (7) the intro parameter to modules/sections/admin/index.php in a secconfig action, which inject PHP sequences into (a) sections/cache/intro.php, (b) mylinks/cache/disclaimer.php, (c) mydownloads/cache/disclaimer.php, (d) newbb_plus/cache/disclaimer.php, (e) system/cache/disclaimer.php, (f) system/cache/footer.php, (g) system/cache/header.php, or (h) system/cache/maintenance.php in modules/.
{
"affected": [],
"aliases": [
"CVE-2007-6548"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-12-28T00:46:00Z",
"severity": "HIGH"
},
"details": "Multiple direct static code injection vulnerabilities in RunCMS before 1.6.1 allow remote authenticated administrators to inject arbitrary PHP code via the (1) header and (2) footer parameters to modules/system/admin.php in a meta-generator action, (3) the disclaimer parameter to modules/system/admin.php in a disclaimer action, (4) the disclaimer parameter to modules/mydownloads/admin/index.php in a mydownloadsConfigAdmin action, (5) the disclaimer parameter to modules/newbb_plus/admin/forum_config.php, (6) the disclaimer parameter to modules/mylinks/admin/index.php in a myLinksConfigAdmin action, or (7) the intro parameter to modules/sections/admin/index.php in a secconfig action, which inject PHP sequences into (a) sections/cache/intro.php, (b) mylinks/cache/disclaimer.php, (c) mydownloads/cache/disclaimer.php, (d) newbb_plus/cache/disclaimer.php, (e) system/cache/disclaimer.php, (f) system/cache/footer.php, (g) system/cache/header.php, or (h) system/cache/maintenance.php in modules/.",
"id": "GHSA-465v-95qw-94v6",
"modified": "2022-05-01T18:44:04Z",
"published": "2022-05-01T18:44:04Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-6548"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4790"
},
{
"type": "WEB",
"url": "http://osvdb.org/41247"
},
{
"type": "WEB",
"url": "http://osvdb.org/41248"
},
{
"type": "WEB",
"url": "http://osvdb.org/41249"
},
{
"type": "WEB",
"url": "http://osvdb.org/41250"
},
{
"type": "WEB",
"url": "http://osvdb.org/41251"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3493"
},
{
"type": "WEB",
"url": "http://www.runcms.org/modules/mydownloads/singlefile.php?lid=131"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/485512/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27019"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-4662-J96G-MV46
Vulnerability from github – Published: 2018-06-07 19:43 – Updated: 2020-08-31 18:12Affected versions of reduce-css-calc pass input directly to eval. If user input is passed into the calc function, this may result in cross-site scripting on the browser, or remote code execution on the server.
Proof of Concept
const reduceCSSCalc = require('reduce-css-calc');
console.log(reduceCSSCalc(`calc( (Buffer(10000)))`));
console.log(reduceCSSCalc(`calc( (global['fs'] = require('fs')))`));
console.log(reduceCSSCalc(`calc( (fs['readFileSync']("/etc/passwd", "utf-8")))`));
Recommendation
Update to version 1.2.5 or later.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "reduce-css-calc"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.2.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2016-10548"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T20:57:38Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "Affected versions of `reduce-css-calc` pass input directly to `eval`. If user input is passed into the calc function, this may result in cross-site scripting on the browser, or remote code execution on the server.\n\n## Proof of Concept\n\n```\nconst reduceCSSCalc = require(\u0027reduce-css-calc\u0027);\nconsole.log(reduceCSSCalc(`calc( (Buffer(10000)))`));\nconsole.log(reduceCSSCalc(`calc( (global[\u0027fs\u0027] = require(\u0027fs\u0027)))`));\nconsole.log(reduceCSSCalc(`calc( (fs[\u0027readFileSync\u0027](\"/etc/passwd\", \"utf-8\")))`));\n```\n\n\n\n## Recommendation\n\nUpdate to version 1.2.5 or later.",
"id": "GHSA-4662-j96g-mv46",
"modified": "2020-08-31T18:12:20Z",
"published": "2018-06-07T19:43:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2016-10548"
},
{
"type": "WEB",
"url": "https://gist.github.com/ChALkeR/415a41b561ebea9b341efbb40b802fc9"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-4662-j96g-mv46"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/144"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Arbitrary Code Injection in reduce-css-calc"
}
GHSA-466P-JWWQ-GCJC
Vulnerability from github – Published: 2022-05-01 07:21 – Updated: 2022-05-01 07:21Unspecified vulnerability in the Server service in Microsoft Windows 2000 SP4, Server 2003 SP1 and earlier, and XP SP2 and earlier allows remote attackers to execute arbitrary code via a crafted packet, aka "SMB Rename Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2006-4696"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-10-10T22:07:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in the Server service in Microsoft Windows 2000 SP4, Server 2003 SP1 and earlier, and XP SP2 and earlier allows remote attackers to execute arbitrary code via a crafted packet, aka \"SMB Rename Vulnerability.\"",
"id": "GHSA-466p-jwwq-gcjc",
"modified": "2022-05-01T07:21:11Z",
"published": "2022-05-01T07:21:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-4696"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2006/ms06-063"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/29373"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A8"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1017035"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/820628"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/449179/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/20373"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/3982"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-46C5-27QX-2W2F
Vulnerability from github – Published: 2022-05-01 18:35 – Updated: 2022-05-01 18:35Multiple PHP remote file inclusion vulnerabilities in PHP Image 1.2 allow remote attackers to execute arbitrary PHP code via a URL in the xarg parameter to (1) xarg_corner.php, (2) xarg_corner_bottom.php, and (3) xarg_corner_top.php.
{
"affected": [],
"aliases": [
"CVE-2007-5697"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-29T21:46:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in PHP Image 1.2 allow remote attackers to execute arbitrary PHP code via a URL in the xarg parameter to (1) xarg_corner.php, (2) xarg_corner_bottom.php, and (3) xarg_corner_top.php.",
"id": "GHSA-46c5-27qx-2w2f",
"modified": "2022-05-01T18:35:53Z",
"published": "2022-05-01T18:35:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5697"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4565"
},
{
"type": "WEB",
"url": "http://osvdb.org/40742"
},
{
"type": "WEB",
"url": "http://osvdb.org/40743"
},
{
"type": "WEB",
"url": "http://osvdb.org/40744"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26187"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-46F2-W34R-PQJ8
Vulnerability from github – Published: 2022-05-02 00:09 – Updated: 2022-05-02 00:09Unspecified vulnerability in the Simba MDrmSap ActiveX control in mdrmsap.dll in SAP SAPgui allows remote attackers to execute arbitrary code via unknown vectors involving instantiation by Internet Explorer.
{
"affected": [],
"aliases": [
"CVE-2008-4387"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-11-10T16:15:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in the Simba MDrmSap ActiveX control in mdrmsap.dll in SAP SAPgui allows remote attackers to execute arbitrary code via unknown vectors involving instantiation by Internet Explorer.",
"id": "GHSA-46f2-w34r-pqj8",
"modified": "2022-05-02T00:09:38Z",
"published": "2022-05-02T00:09:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4387"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/46440"
},
{
"type": "WEB",
"url": "http://osvdb.org/49721"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/277313"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/32186"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/3106"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation
Strategy: Refactoring
Refactor your program so that you do not have to dynamically generate code.
Mitigation
- Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
- Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
Mitigation MIT-32
Strategy: Compilation or Build Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation MIT-32
Strategy: Environment Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation
For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
CAPEC-242: Code Injection
An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.