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.
8323 vulnerabilities reference this CWE, most recent first.
GHSA-2PMX-6MM6-6V72
Vulnerability from github – Published: 2022-05-17 01:13 – Updated: 2024-04-24 22:53Smarty before 3.1.21 allows remote attackers to bypass the secure mode restrictions and execute arbitrary PHP code as demonstrated by "{literal}<{/literal}script language=php>" in a template.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "smarty/smarty"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.21"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2014-8350"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-04-24T22:53:34Z",
"nvd_published_at": "2014-11-03T16:55:00Z",
"severity": "HIGH"
},
"details": "Smarty before 3.1.21 allows remote attackers to bypass the secure mode restrictions and execute arbitrary PHP code as demonstrated by \"{literal}\u003c{/literal}script language=php\u003e\" in a template.",
"id": "GHSA-2pmx-6mm6-6v72",
"modified": "2024-04-24T22:53:34Z",
"published": "2022-05-17T01:13:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-8350"
},
{
"type": "WEB",
"url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765920"
},
{
"type": "WEB",
"url": "https://code.google.com/p/smarty-php/source/browse/trunk/distribution/change_log.txt?r=4902"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/97725"
},
{
"type": "PACKAGE",
"url": "https://github.com/smarty-php/smarty"
},
{
"type": "WEB",
"url": "http://advisories.mageia.org/MGASA-2014-0468.html"
},
{
"type": "WEB",
"url": "http://seclists.org/oss-sec/2014/q4/420"
},
{
"type": "WEB",
"url": "http://seclists.org/oss-sec/2014/q4/421"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2014:221"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/70708"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Smarty arbitrary PHP code execution"
}
GHSA-2PP3-2HR3-936M
Vulnerability from github – Published: 2024-12-18 15:33 – Updated: 2024-12-18 15:33A relative path traversal in Fortinet FortiWLM version 8.6.0 through 8.6.5 and 8.5.0 through 8.5.4 allows attacker to execute unauthorized code or commands via specially crafted web requests.
{
"affected": [],
"aliases": [
"CVE-2023-34990"
],
"database_specific": {
"cwe_ids": [
"CWE-23",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-12-18T13:15:05Z",
"severity": "CRITICAL"
},
"details": "A relative path traversal in Fortinet FortiWLM version 8.6.0 through 8.6.5 and 8.5.0 through 8.5.4 allows attacker to execute unauthorized code or commands via specially crafted web requests.",
"id": "GHSA-2pp3-2hr3-936m",
"modified": "2024-12-18T15:33:00Z",
"published": "2024-12-18T15:33:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-34990"
},
{
"type": "WEB",
"url": "https://fortiguard.com/psirt/FG-IR-23-144"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-2PVM-P3X6-GXVP
Vulnerability from github – Published: 2022-05-24 17:49 – Updated: 2022-07-13 00:01An arbitrary code execution vulnerability exists in Micro Focus Application Performance Management, affecting versions 9.40, 9.50 and 9.51. The vulnerability could allow remote attackers to execute arbitrary code on affected installations of APM.
{
"affected": [],
"aliases": [
"CVE-2021-22514"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-04-28T12:15:00Z",
"severity": "CRITICAL"
},
"details": "An arbitrary code execution vulnerability exists in Micro Focus Application Performance Management, affecting versions 9.40, 9.50 and 9.51. The vulnerability could allow remote attackers to execute arbitrary code on affected installations of APM.",
"id": "GHSA-2pvm-p3x6-gxvp",
"modified": "2022-07-13T00:01:10Z",
"published": "2022-05-24T17:49:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-22514"
},
{
"type": "WEB",
"url": "https://softwaresupport.softwaregrp.com/doc/KM03806649"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-2Q62-RW6M-PCHG
Vulnerability from github – Published: 2022-05-01 02:16 – Updated: 2025-01-16 21:30Eval injection vulnerability in bvh_import.py in Blender 2.36 allows attackers to execute arbitrary Python code via a hierarchy element in a .bvh file, which is supplied to an eval function call.
{
"affected": [],
"aliases": [
"CVE-2005-3302"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2005-10-24T10:02:00Z",
"severity": "HIGH"
},
"details": "Eval injection vulnerability in bvh_import.py in Blender 2.36 allows attackers to execute arbitrary Python code via a hierarchy element in a .bvh file, which is supplied to an eval function call.",
"id": "GHSA-2q62-rw6m-pchg",
"modified": "2025-01-16T21:30:54Z",
"published": "2022-05-01T02:16:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2005-3302"
},
{
"type": "WEB",
"url": "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=330895"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/19754"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2006/dsa-1039"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/17663"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-2Q6F-JMHV-H8GR
Vulnerability from github – Published: 2022-05-14 01:49 – Updated: 2022-05-14 01:49statics/app/index/controller/Install.php in YUNUCMS 1.1.5 (if install.lock is not present) allows remote attackers to execute arbitrary PHP code by placing this code in the index.php?s=index/install/setup2 DB_PREFIX field, which is written to database.php.
{
"affected": [],
"aliases": [
"CVE-2018-19180"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-11-11T17:29:00Z",
"severity": "CRITICAL"
},
"details": "statics/app/index/controller/Install.php in YUNUCMS 1.1.5 (if install.lock is not present) allows remote attackers to execute arbitrary PHP code by placing this code in the index.php?s=index/install/setup2 DB_PREFIX field, which is written to database.php.",
"id": "GHSA-2q6f-jmhv-h8gr",
"modified": "2022-05-14T01:49:56Z",
"published": "2022-05-14T01:49:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-19180"
},
{
"type": "WEB",
"url": "https://github.com/doublefast/yunucms/issues/1"
}
],
"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-2Q7J-JRWG-8822
Vulnerability from github – Published: 2022-04-30 18:11 – Updated: 2025-04-03 03:34Internet Explorer 5.0 and 5.01 allows remote attackers to modify or execute files via the Import/Export Favorites feature, aka the "ImportExportFavorites" vulnerability.
{
"affected": [],
"aliases": [
"CVE-1999-0702"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "1999-09-10T04:00:00Z",
"severity": "HIGH"
},
"details": "Internet Explorer 5.0 and 5.01 allows remote attackers to modify or execute files via the Import/Export Favorites feature, aka the \"ImportExportFavorites\" vulnerability.",
"id": "GHSA-2q7j-jrwg-8822",
"modified": "2025-04-03T03:34:42Z",
"published": "2022-04-30T18:11:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-1999-0702"
},
{
"type": "WEB",
"url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/1999/ms99-037"
},
{
"type": "WEB",
"url": "http://support.microsoft.com/default.aspx?scid=kb%3B%5BLN%5D%3BQ241361"
},
{
"type": "WEB",
"url": "http://support.microsoft.com/default.aspx?scid=kb;[LN];Q241361"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/627"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-2Q7X-W5Q3-RJXC
Vulnerability from github – Published: 2022-05-24 17:44 – Updated: 2022-05-24 17:44A remote code execution issue was discovered in MariaDB 10.2 before 10.2.37, 10.3 before 10.3.28, 10.4 before 10.4.18, and 10.5 before 10.5.9; Percona Server through 2021-03-03; and the wsrep patch through 2021-03-03 for MySQL. An untrusted search path leads to eval injection, in which a database SUPER user can execute OS commands after modifying wsrep_provider and wsrep_notify_cmd. NOTE: this does not affect an Oracle product.
{
"affected": [],
"aliases": [
"CVE-2021-27928"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-03-19T03:15:00Z",
"severity": "HIGH"
},
"details": "A remote code execution issue was discovered in MariaDB 10.2 before 10.2.37, 10.3 before 10.3.28, 10.4 before 10.4.18, and 10.5 before 10.5.9; Percona Server through 2021-03-03; and the wsrep patch through 2021-03-03 for MySQL. An untrusted search path leads to eval injection, in which a database SUPER user can execute OS commands after modifying wsrep_provider and wsrep_notify_cmd. NOTE: this does not affect an Oracle product.",
"id": "GHSA-2q7x-w5q3-rjxc",
"modified": "2022-05-24T17:44:56Z",
"published": "2022-05-24T17:44:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-27928"
},
{
"type": "WEB",
"url": "https://jira.mariadb.org/browse/MDEV-25179"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2021/03/msg00028.html"
},
{
"type": "WEB",
"url": "https://mariadb.com/kb/en/mariadb-10237-release-notes"
},
{
"type": "WEB",
"url": "https://mariadb.com/kb/en/mariadb-10328-release-notes"
},
{
"type": "WEB",
"url": "https://mariadb.com/kb/en/mariadb-10418-release-notes"
},
{
"type": "WEB",
"url": "https://mariadb.com/kb/en/mariadb-1059-release-notes"
},
{
"type": "WEB",
"url": "https://mariadb.com/kb/en/security"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202105-28"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/162177/MariaDB-10.2-Command-Execution.html"
}
],
"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-2Q96-RRQQ-JJ73
Vulnerability from github – Published: 2022-05-01 23:54 – Updated: 2025-04-09 03:55PHP remote file inclusion vulnerability in include/plugins/jrBrowser/payment.php in Jamroom 3.3.0 through 3.3.5 allows remote attackers to execute arbitrary PHP code via a URL in the jamroom[jm_dir] parameter. NOTE: some of these details are obtained from third party information.
{
"affected": [],
"aliases": [
"CVE-2008-2883"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-06-26T17:41:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in include/plugins/jrBrowser/payment.php in Jamroom 3.3.0 through 3.3.5 allows remote attackers to execute arbitrary PHP code via a URL in the jamroom[jm_dir] parameter. NOTE: some of these details are obtained from third party information.",
"id": "GHSA-2q96-rrqq-jj73",
"modified": "2025-04-09T03:55:50Z",
"published": "2022-05-01T23:54:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2883"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/5876"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/30806"
},
{
"type": "WEB",
"url": "http://www.jamroom.net"
},
{
"type": "WEB",
"url": "http://www.jamroom.net/index.php?m=td_tracker\u0026o=view\u0026id=1130"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-2Q9V-9RR4-W95C
Vulnerability from github – Published: 2022-05-14 02:42 – Updated: 2022-05-14 02:42The frame decompression functionality in the VMnc media codec in VMware Movie Decoder before 6.5.5 build 328052 and 7.x before 7.1.2 build 301548, VMware Workstation 6.5.x before 6.5.5 build 328052 and 7.x before 7.1.2 build 301548 on Windows, VMware Player 2.5.x before 2.5.5 build 246459 and 3.x before 3.1.2 build 301548 on Windows, and VMware Server 2.x on Windows does not properly validate an unspecified size field, which allows remote attackers to execute arbitrary code or cause a denial of service (heap memory corruption) via a crafted video file.
{
"affected": [],
"aliases": [
"CVE-2010-4294"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-12-06T21:05:00Z",
"severity": "HIGH"
},
"details": "The frame decompression functionality in the VMnc media codec in VMware Movie Decoder before 6.5.5 build 328052 and 7.x before 7.1.2 build 301548, VMware Workstation 6.5.x before 6.5.5 build 328052 and 7.x before 7.1.2 build 301548 on Windows, VMware Player 2.5.x before 2.5.5 build 246459 and 3.x before 3.1.2 build 301548 on Windows, and VMware Server 2.x on Windows does not properly validate an unspecified size field, which allows remote attackers to execute arbitrary code or cause a denial of service (heap memory corruption) via a crafted video file.",
"id": "GHSA-2q9v-9rr4-w95c",
"modified": "2022-05-14T02:42:25Z",
"published": "2022-05-14T02:42:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-4294"
},
{
"type": "WEB",
"url": "http://lists.vmware.com/pipermail/security-announce/2010/000112.html"
},
{
"type": "WEB",
"url": "http://osvdb.org/69596"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/42482"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/514995/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/45169"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1024819"
},
{
"type": "WEB",
"url": "http://www.vmware.com/security/advisories/VMSA-2010-0018.html"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2010/3116"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-2QC8-39FH-F2V4
Vulnerability from github – Published: 2022-05-02 03:55 – Updated: 2022-05-02 03:55Multiple PHP remote file inclusion vulnerabilities in FreeSchool 1.1.0 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the CLASSPATH parameter to (1) bib_form.php, (2) bib_pldetails.php, (3) bib_plform.php, (4) bib_plsearchc.php, (5) bib_plsearchs.php, (6) bib_save.php, (7) bib_searchc.php, (8) bib_searchs.php, (9) edi_form.php, (10) edi_save.php, (11) gen_form.php, (12) gen_save.php, (13) lin_form.php, (14) lin_save.php, (15) luo_form.php, (16) luo_save.php, (17) sog_form.php, or (18) sog_save.php in biblioteca/; (19) cal_insert.php, (20) cal_save.php, or (21) cal_saveactivity.php in calendario/; (22) circolari/cir_save.php; or (23) modulistica/mdl_save.php.
{
"affected": [],
"aliases": [
"CVE-2009-4471"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-12-30T21:30:00Z",
"severity": "HIGH"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in FreeSchool 1.1.0 and earlier allow remote attackers to execute arbitrary PHP code via a URL in the CLASSPATH parameter to (1) bib_form.php, (2) bib_pldetails.php, (3) bib_plform.php, (4) bib_plsearchc.php, (5) bib_plsearchs.php, (6) bib_save.php, (7) bib_searchc.php, (8) bib_searchs.php, (9) edi_form.php, (10) edi_save.php, (11) gen_form.php, (12) gen_save.php, (13) lin_form.php, (14) lin_save.php, (15) luo_form.php, (16) luo_save.php, (17) sog_form.php, or (18) sog_save.php in biblioteca/; (19) cal_insert.php, (20) cal_save.php, or (21) cal_saveactivity.php in calendario/; (22) circolari/cir_save.php; or (23) modulistica/mdl_save.php.",
"id": "GHSA-2qc8-39fh-f2v4",
"modified": "2022-05-02T03:55:12Z",
"published": "2022-05-02T03:55:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4471"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/53017"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/36605"
},
{
"type": "WEB",
"url": "http://www.exploit-db.com/exploits/9582"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2009/2535"
}
],
"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.