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.
8343 vulnerabilities reference this CWE, most recent first.
GHSA-RFMF-RX8W-935W
Vulnerability from github – Published: 2017-10-24 18:33 – Updated: 2023-07-03 21:20lib/sounder/sound.rb in the sounder gem 1.0.1 for Ruby allows remote attackers to execute arbitrary commands via shell metacharacters in a filename.
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "sounder"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2013-5647"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:54:35Z",
"nvd_published_at": "2013-08-29T12:07:56Z",
"severity": "HIGH"
},
"details": "lib/sounder/sound.rb in the sounder gem 1.0.1 for Ruby allows remote attackers to execute arbitrary commands via shell metacharacters in a filename.",
"id": "GHSA-rfmf-rx8w-935w",
"modified": "2023-07-03T21:20:17Z",
"published": "2017-10-24T18:33:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-5647"
},
{
"type": "PACKAGE",
"url": "https://github.com/adamzaninovich/sounder"
},
{
"type": "WEB",
"url": "https://github.com/adamzaninovich/sounder/blob/v1.0.1/lib/sounder/sound.rb"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-rfmf-rx8w-935w"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sounder/CVE-2013-5647.yml"
},
{
"type": "WEB",
"url": "http://vapid.dhs.org/advisories/sounder-ruby-gem-cmd-inj.html"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Sounder Contains Arbitrary Command Execution Vulnerability"
}
GHSA-RFP2-4WXC-F3JF
Vulnerability from github – Published: 2022-05-01 23:50 – Updated: 2022-05-01 23:50Multiple PHP remote file inclusion vulnerabilities in BigACE 2.4, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the (1) GLOBALS[_BIGACE][DIR][addon] parameter to (a) addon/smarty/plugins/function.captcha.php and (b) system/classes/sql/AdoDBConnection.php; and the (2) GLOBALS[_BIGACE][DIR][admin] parameter to (c) item_information.php and (d) jstree.php in system/application/util/, and (e) system/admin/plugins/menu/menuTree/plugin.php, different vectors than CVE-2006-4423.
{
"affected": [],
"aliases": [
"CVE-2008-2520"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-06-03T15:32:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in BigACE 2.4, when register_globals is enabled, allow remote attackers to execute arbitrary PHP code via a URL in the (1) GLOBALS[_BIGACE][DIR][addon] parameter to (a) addon/smarty/plugins/function.captcha.php and (b) system/classes/sql/AdoDBConnection.php; and the (2) GLOBALS[_BIGACE][DIR][admin] parameter to (c) item_information.php and (d) jstree.php in system/application/util/, and (e) system/admin/plugins/menu/menuTree/plugin.php, different vectors than CVE-2006-4423.",
"id": "GHSA-rfp2-4wxc-f3jf",
"modified": "2022-05-01T23:50:48Z",
"published": "2022-05-01T23:50:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2520"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/42343"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/5596"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/30183"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/29157"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RFXV-RPWJ-GVC7
Vulnerability from github – Published: 2025-02-13 00:33 – Updated: 2025-02-14 18:30Cross Site Scripting vulnerability in Zertificon Z1 SecureMail Z1 CertServer v.3.16.4-2516-debian12 alllows a remote attacker to execute arbitrary code via the ST, L, O, OU, CN parameters.
{
"affected": [],
"aliases": [
"CVE-2024-51122"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-12T22:15:39Z",
"severity": "MODERATE"
},
"details": "Cross Site Scripting vulnerability in Zertificon Z1 SecureMail Z1 CertServer v.3.16.4-2516-debian12 alllows a remote attacker to execute arbitrary code via the ST, L, O, OU, CN parameters.",
"id": "GHSA-rfxv-rpwj-gvc7",
"modified": "2025-02-14T18:30:49Z",
"published": "2025-02-13T00:33:07Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51122"
},
{
"type": "WEB",
"url": "https://github.com/MVRC-ITSEC/CVEs/blob/main/CVE-2024-51122"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-RG23-WF5C-RHRF
Vulnerability from github – Published: 2022-05-01 23:35 – Updated: 2022-05-01 23:35Apple QuickTime before 7.4.5 does not properly handle movie media tracks, which allows remote attackers to execute arbitrary code via a crafted movie that triggers memory corruption.
{
"affected": [],
"aliases": [
"CVE-2008-1016"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-04-04T17:44:00Z",
"severity": "MODERATE"
},
"details": "Apple QuickTime before 7.4.5 does not properly handle movie media tracks, which allows remote attackers to execute arbitrary code via a crafted movie that triggers memory corruption.",
"id": "GHSA-rg23-wf5c-rhrf",
"modified": "2022-05-01T23:35:55Z",
"published": "2022-05-01T23:35:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1016"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/41605"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29650"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1019760"
},
{
"type": "WEB",
"url": "http://support.apple.com/kb/HT1241"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28583"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA08-094A.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/1078"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RG38-827X-4Q2G
Vulnerability from github – Published: 2022-05-17 03:57 – Updated: 2025-04-12 12:47PHP remote file inclusion vulnerability in the fetchView function in the Mage_Core_Block_Template_Zend class in Magento Community Edition (CE) 1.9.1.0 and Enterprise Edition (EE) 1.14.1.0 allows remote administrators to execute arbitrary PHP code via a URL in unspecified vectors involving the setScriptPath function. NOTE: it is not clear whether this issue crosses privilege boundaries, since administrators might already have privileges to include arbitrary files.
{
"affected": [],
"aliases": [
"CVE-2015-1399"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2015-04-29T22:59:00Z",
"severity": "MODERATE"
},
"details": "PHP remote file inclusion vulnerability in the fetchView function in the Mage_Core_Block_Template_Zend class in Magento Community Edition (CE) 1.9.1.0 and Enterprise Edition (EE) 1.14.1.0 allows remote administrators to execute arbitrary PHP code via a URL in unspecified vectors involving the setScriptPath function. NOTE: it is not clear whether this issue crosses privilege boundaries, since administrators might already have privileges to include arbitrary files.",
"id": "GHSA-rg38-827x-4q2g",
"modified": "2025-04-12T12:47:37Z",
"published": "2022-05-17T03:57:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-1399"
},
{
"type": "WEB",
"url": "http://blog.checkpoint.com/2015/04/20/analyzing-magento-vulnerability"
},
{
"type": "WEB",
"url": "http://magento.com/blog/technical/critical-security-advisory-remote-code-execution-rce-vulnerability"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id/1032194"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RG3V-469F-2GXQ
Vulnerability from github – Published: 2022-05-14 03:27 – Updated: 2022-05-14 03:27sys_verifies.php in DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the refiles array parameter, because the contents of modifytmp.inc are under an attacker's control.
{
"affected": [],
"aliases": [
"CVE-2018-9174"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-04-02T03:29:00Z",
"severity": "CRITICAL"
},
"details": "sys_verifies.php in DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the refiles array parameter, because the contents of modifytmp.inc are under an attacker\u0027s control.",
"id": "GHSA-rg3v-469f-2gxq",
"modified": "2022-05-14T03:27:50Z",
"published": "2022-05-14T03:27:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-9174"
},
{
"type": "WEB",
"url": "https://xz.aliyun.com/t/2237"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-RG5X-2RM4-GX5F
Vulnerability from github – Published: 2022-05-14 02:35 – Updated: 2022-05-14 02:35Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by accessing a deleted object, aka "Asynchronous NULL Object Access Remote Code Execution Vulnerability."
{
"affected": [],
"aliases": [
"CVE-2012-2521"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-08-15T01:55:00Z",
"severity": "HIGH"
},
"details": "Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by accessing a deleted object, aka \"Asynchronous NULL Object Access Remote Code Execution Vulnerability.\"",
"id": "GHSA-rg5x-2rm4-gx5f",
"modified": "2022-05-14T02:35:09Z",
"published": "2022-05-14T02:35:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-2521"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2012/ms12-052"
},
{
"type": "WEB",
"url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A15742"
},
{
"type": "WEB",
"url": "http://www.us-cert.gov/cas/techalerts/TA12-227A.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-RG79-MPC6-WJW2
Vulnerability from github – Published: 2022-05-14 03:27 – Updated: 2022-05-14 03:27DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the egroup parameter to uploads/dede/stepselect_main.php because code within the database is accessible to uploads/dede/sys_cache_up.php.
{
"affected": [],
"aliases": [
"CVE-2018-9175"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-04-02T03:29:00Z",
"severity": "CRITICAL"
},
"details": "DedeCMS 5.7 allows remote attackers to execute arbitrary PHP code via the egroup parameter to uploads/dede/stepselect_main.php because code within the database is accessible to uploads/dede/sys_cache_up.php.",
"id": "GHSA-rg79-mpc6-wjw2",
"modified": "2022-05-14T03:27:50Z",
"published": "2022-05-14T03:27:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-9175"
},
{
"type": "WEB",
"url": "https://xz.aliyun.com/t/2237"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-RGFF-87C8-RH44
Vulnerability from github – Published: 2022-05-14 01:27 – Updated: 2024-03-21 03:33** DISPUTED ** Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key parameter. NOTE: the vendor points out that Twig itself is not a web application and states that it is the responsibility of web applications using Twig to properly wrap input to it.
{
"affected": [],
"aliases": [
"CVE-2018-13818"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-07-10T14:29:00Z",
"severity": "CRITICAL"
},
"details": "** DISPUTED ** Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key parameter. NOTE: the vendor points out that Twig itself is not a web application and states that it is the responsibility of web applications using Twig to properly wrap input to it.",
"id": "GHSA-rgff-87c8-rh44",
"modified": "2024-03-21T03:33:31Z",
"published": "2022-05-14T01:27:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-13818"
},
{
"type": "WEB",
"url": "https://github.com/twigphp/Twig/issues/2743"
},
{
"type": "WEB",
"url": "https://github.com/twigphp/Twig/commit/eddb97148ad779f27e670e1e3f19fb323aedafeb"
},
{
"type": "WEB",
"url": "https://github.com/twigphp/Twig/blob/2.x/CHANGELOG"
},
{
"type": "WEB",
"url": "https://mobile.twitter.com/jameel_nabbo/status/1032593354704515072?s=20"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/44102"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-RGGC-4JRG-R8G6
Vulnerability from github – Published: 2024-03-28 21:30 – Updated: 2024-08-27 21:31The YI Smart Kami Vision com.kamivision.yismart application through 1.0.0_20231219 for Android allows a remote attacker to execute arbitrary JavaScript code via an implicit intent to the com.ants360.yicamera.activity.WebViewActivity component.
{
"affected": [],
"aliases": [
"CVE-2024-23727"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-03-28T21:16:01Z",
"severity": "HIGH"
},
"details": "The YI Smart Kami Vision com.kamivision.yismart application through 1.0.0_20231219 for Android allows a remote attacker to execute arbitrary JavaScript code via an implicit intent to the com.ants360.yicamera.activity.WebViewActivity component.",
"id": "GHSA-rggc-4jrg-r8g6",
"modified": "2024-08-27T21:31:11Z",
"published": "2024-03-28T21:30:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-23727"
},
{
"type": "WEB",
"url": "https://github.com/actuator/yi/blob/main/com.kamivision.yismart.V1.0.0_20231219.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation
Strategy: Refactoring
Refactor your program so that you do not have to dynamically generate code.
Mitigation
- Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
- Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
Mitigation MIT-32
Strategy: Compilation or Build Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation MIT-32
Strategy: Environment Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation
For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
CAPEC-242: Code Injection
An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.