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-HM7F-5JXX-CWVG
Vulnerability from github – Published: 2022-05-13 01:54 – Updated: 2022-05-13 01:54mod_perl 2.0 through 2.0.10 allows attackers to execute arbitrary Perl code by placing it in a user-owned .htaccess file, because (contrary to the documentation) there is no configuration option that permits Perl code for the administrator's control of HTTP request processing without also permitting unprivileged users to run Perl code in the context of the user account that runs Apache HTTP Server processes.
{
"affected": [],
"aliases": [
"CVE-2011-2767"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-08-26T16:29:00Z",
"severity": "CRITICAL"
},
"details": "mod_perl 2.0 through 2.0.10 allows attackers to execute arbitrary Perl code by placing it in a user-owned .htaccess file, because (contrary to the documentation) there is no configuration option that permits Perl code for the administrator\u0027s control of HTTP request processing without also permitting unprivileged users to run Perl code in the context of the user account that runs Apache HTTP Server processes.",
"id": "GHSA-hm7f-5jxx-cwvg",
"modified": "2022-05-13T01:54:08Z",
"published": "2022-05-13T01:54:08Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-2767"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2018:2737"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2018:2825"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2018:2826"
},
{
"type": "WEB",
"url": "https://bugs.debian.org/644169"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/c8ebe8aad147a3ad2e7b0e8b2da45263171ab5d0fc7f8c100feaa94d@%3Cmodperl-cvs.perl.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2018/09/msg00018.html"
},
{
"type": "WEB",
"url": "https://mail-archives.apache.org/mod_mbox/perl-modperl/201110.mbox/raw/%3C20111004084343.GA21290%40ktnx.net%3E"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3825-1"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3825-2"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00063.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2019-11/msg00065.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/105195"
}
],
"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-HM7G-WJ92-RJ6W
Vulnerability from github – Published: 2023-11-03 00:30 – Updated: 2024-09-06 15:32An issue in lmxcms v.1.41 allows a remote attacker to execute arbitrary code via a crafted script to the admin.php file.
{
"affected": [],
"aliases": [
"CVE-2023-46958"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-11-02T22:15:09Z",
"severity": "CRITICAL"
},
"details": "An issue in lmxcms v.1.41 allows a remote attacker to execute arbitrary code via a crafted script to the admin.php file.",
"id": "GHSA-hm7g-wj92-rj6w",
"modified": "2024-09-06T15:32:54Z",
"published": "2023-11-03T00:30:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46958"
},
{
"type": "WEB",
"url": "https://gist.github.com/durian5201314/6507d1057c62f4bf93e740a631617434"
},
{
"type": "WEB",
"url": "http://lmxcms.com"
},
{
"type": "WEB",
"url": "http://www.lmxcms.com"
}
],
"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-HM7V-P5F8-CV9H
Vulnerability from github – Published: 2022-05-17 04:48 – Updated: 2025-03-31 12:30Multiple incomplete blacklist vulnerabilities in (1) import.php and (2) ajax/uploadimport.php in apps/contacts/ in ownCloud before 4.0.13 and 4.5.x before 4.5.8 allow remote authenticated users to execute arbitrary PHP code by uploading a .htaccess file.
{
"affected": [],
"aliases": [
"CVE-2013-1850"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-03-14T16:55:00Z",
"severity": "MODERATE"
},
"details": "Multiple incomplete blacklist vulnerabilities in (1) import.php and (2) ajax/uploadimport.php in apps/contacts/ in ownCloud before 4.0.13 and 4.5.x before 4.5.8 allow remote authenticated users to execute arbitrary PHP code by uploading a .htaccess file.",
"id": "GHSA-hm7v-p5f8-cv9h",
"modified": "2025-03-31T12:30:34Z",
"published": "2022-05-17T04:48:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-1850"
},
{
"type": "WEB",
"url": "http://owncloud.org/about/security/advisories/oC-SA-2013-009"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HM9P-F2CP-2W64
Vulnerability from github – Published: 2022-01-27 00:00 – Updated: 2026-07-05 03:30jpress v 4.2.0 is vulnerable to RCE via io.jpress.module.product.ProductNotifyKit#doSendEmail. The admin panel provides a function through which attackers can edit the email templates and inject some malicious code.
{
"affected": [],
"aliases": [
"CVE-2021-46114"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-01-26T19:15:00Z",
"severity": "HIGH"
},
"details": "jpress v 4.2.0 is vulnerable to RCE via io.jpress.module.product.ProductNotifyKit#doSendEmail. The admin panel provides a function through which attackers can edit the email templates and inject some malicious code.",
"id": "GHSA-hm9p-f2cp-2w64",
"modified": "2026-07-05T03:30:44Z",
"published": "2022-01-27T00:00:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-46114"
},
{
"type": "WEB",
"url": "https://github.com/JPressProjects/jpress/issues/172"
},
{
"type": "WEB",
"url": "https://github.com/JPressProjects/jpress"
},
{
"type": "WEB",
"url": "http://jpress.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"
}
]
}
GHSA-HMCW-CRCX-V3Q6
Vulnerability from github – Published: 2022-05-01 18:43 – Updated: 2022-05-01 18:43Anon Proxy Server 0.100, and probably 0.101, allows remote attackers to execute arbitrary commands via shell metacharacters in (1) the host parameter to diagdns.php, and (2) the host parameter and possibly (3) the port parameter to diagconnect.php, a different vulnerability than CVE-2007-6460.
{
"affected": [],
"aliases": [
"CVE-2007-6459"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-12-20T00:46:00Z",
"severity": "MODERATE"
},
"details": "Anon Proxy Server 0.100, and probably 0.101, allows remote attackers to execute arbitrary commands via shell metacharacters in (1) the host parameter to diagdns.php, and (2) the host parameter and possibly (3) the port parameter to diagconnect.php, a different vulnerability than CVE-2007-6460.",
"id": "GHSA-hmcw-crcx-v3q6",
"modified": "2022-05-01T18:43:14Z",
"published": "2022-05-01T18:43:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-6459"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4734"
},
{
"type": "WEB",
"url": "http://osvdb.org/43711"
},
{
"type": "WEB",
"url": "http://osvdb.org/43712"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3463"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/485151/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/26882"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HMG3-H6WX-FMC2
Vulnerability from github – Published: 2022-05-01 18:28 – Updated: 2024-03-21 03:32** DISPUTED ** PHP remote file inclusion vulnerability in form/db_form/employee.php in PHPortal 0.2.7 allows remote attackers to execute arbitrary PHP code via a URL in the DOCUMENT_ROOT parameter. NOTE: this issue is disputed by CVE, since DOCUMENT_ROOT cannot be modified by an attacker.
{
"affected": [],
"aliases": [
"CVE-2007-4950"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-09-18T20:17:00Z",
"severity": "MODERATE"
},
"details": "** DISPUTED ** PHP remote file inclusion vulnerability in form/db_form/employee.php in PHPortal 0.2.7 allows remote attackers to execute arbitrary PHP code via a URL in the DOCUMENT_ROOT parameter. NOTE: this issue is disputed by CVE, since DOCUMENT_ROOT cannot be modified by an attacker.",
"id": "GHSA-hmg3-h6wx-fmc2",
"modified": "2024-03-21T03:32:57Z",
"published": "2022-05-01T18:28:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4950"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/42477"
},
{
"type": "WEB",
"url": "http://arfis.wordpress.com/2007/09/14/rfi-03-phportal"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25717"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HMGQ-QQ8H-7RFM
Vulnerability from github – Published: 2024-11-09 12:30 – Updated: 2024-11-09 12:30The The Paid Membership Subscriptions – Effortless Memberships, Recurring Payments & Content Restriction plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 2.13.0. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.
{
"affected": [],
"aliases": [
"CVE-2024-10261"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-11-09T12:15:16Z",
"severity": "HIGH"
},
"details": "The The Paid Membership Subscriptions \u2013 Effortless Memberships, Recurring Payments \u0026 Content Restriction plugin for WordPress is vulnerable to arbitrary shortcode execution in all versions up to, and including, 2.13.0. This is due to the software allowing users to execute an action that does not properly validate a value before running do_shortcode. This makes it possible for unauthenticated attackers to execute arbitrary shortcodes.",
"id": "GHSA-hmgq-qq8h-7rfm",
"modified": "2024-11-09T12:30:49Z",
"published": "2024-11-09T12:30:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-10261"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3182968/paid-member-subscriptions"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/eaf19371-7b06-45c6-bf16-6ef7dfffb175?source=cve"
}
],
"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-HMHP-M2MF-H8M9
Vulnerability from github – Published: 2024-09-10 09:31 – Updated: 2024-09-10 09:31An unauthenticated remote attacker can run malicious c# code included in curve files and execute commands in the users context.
{
"affected": [],
"aliases": [
"CVE-2024-6596"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-09-10T08:15:03Z",
"severity": "CRITICAL"
},
"details": "An unauthenticated remote attacker can run malicious c# code included in curve files and execute commands in the users context.",
"id": "GHSA-hmhp-m2mf-h8m9",
"modified": "2024-09-10T09:31:11Z",
"published": "2024-09-10T09:31:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6596"
},
{
"type": "WEB",
"url": "https://cert.vde.com/en/advisories/VDE-2024-041"
}
],
"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-HMJ9-32VF-6QXP
Vulnerability from github – Published: 2022-05-01 06:53 – Updated: 2022-05-01 06:53Unspecified vulnerability in phpBB allows remote authenticated users with Administration Panel access to execute arbitrary PHP code via crafted Font Colour 3 ($theme[fontcolor3] variable) and/or signature values, possibly involving the highlight functionality. NOTE: the original report does not clarify whether this issue is static code injection, eval injection, or another type of vulnerability.
{
"affected": [],
"aliases": [
"CVE-2006-1896"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-04-20T10:02:00Z",
"severity": "MODERATE"
},
"details": "Unspecified vulnerability in phpBB allows remote authenticated users with Administration Panel access to execute arbitrary PHP code via crafted Font Colour 3 ($theme[fontcolor3] variable) and/or signature values, possibly involving the highlight functionality. NOTE: the original report does not clarify whether this issue is static code injection, eval injection, or another type of vulnerability.",
"id": "GHSA-hmj9-32vf-6qxp",
"modified": "2022-05-01T06:53:44Z",
"published": "2022-05-01T06:53:44Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-1896"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/25889"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/20093"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/20197"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/715"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/762"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2006/dsa-1066"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/431015/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/431387/100/0/threaded"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HMQ8-XVRM-7XQJ
Vulnerability from github – Published: 2024-08-13 12:30 – Updated: 2024-08-13 12:30Improper Control of Generation of Code ('Code Injection') vulnerability in WC Product Table WooCommerce Product Table Lite allows Code Injection.This issue affects WooCommerce Product Table Lite: from n/a through 3.5.1.
{
"affected": [],
"aliases": [
"CVE-2024-43128"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-08-13T11:15:18Z",
"severity": "MODERATE"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in WC Product Table WooCommerce Product Table Lite allows Code Injection.This issue affects WooCommerce Product Table Lite: from n/a through 3.5.1.",
"id": "GHSA-hmq8-xvrm-7xqj",
"modified": "2024-08-13T12:30:53Z",
"published": "2024-08-13T12:30:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-43128"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/wc-product-table-lite/wordpress-woocommerce-product-table-lite-plugin-3-5-1-arbitrary-code-execution-vulnerability?_s_id=cve"
}
],
"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:N",
"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.