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.
8379 vulnerabilities reference this CWE, most recent first.
GHSA-6XRH-9PPX-MV3H
Vulnerability from github – Published: 2022-01-14 00:02 – Updated: 2022-07-13 00:01jpress v4.2.0 admin panel provides a function through which attackers can modify the template and inject some malicious code.
{
"affected": [],
"aliases": [
"CVE-2021-45806"
],
"database_specific": {
"cwe_ids": [
"CWE-77",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-01-13T14:15:00Z",
"severity": "HIGH"
},
"details": "jpress v4.2.0 admin panel provides a function through which attackers can modify the template and inject some malicious code.",
"id": "GHSA-6xrh-9ppx-mv3h",
"modified": "2022-07-13T00:01:51Z",
"published": "2022-01-14T00:02:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-45806"
},
{
"type": "WEB",
"url": "https://github.com/JPressProjects/jpress/issues/166"
},
{
"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-6XRW-49J6-7F3M
Vulnerability from github – Published: 2024-04-03 06:30 – Updated: 2024-08-20 18:31Arbitrary file write vulnerability in beescms v.4.0, allows a remote attacker to execute arbitrary code via a file path that was not isolated and the suffix was not verified in admin_template.php.
{
"affected": [],
"aliases": [
"CVE-2024-31011"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-03T05:15:48Z",
"severity": "CRITICAL"
},
"details": "Arbitrary file write vulnerability in beescms v.4.0, allows a remote attacker to execute arbitrary code via a file path that was not isolated and the suffix was not verified in admin_template.php.",
"id": "GHSA-6xrw-49j6-7f3m",
"modified": "2024-08-20T18:31:14Z",
"published": "2024-04-03T06:30:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-31011"
},
{
"type": "WEB",
"url": "https://github.com/ss122-0ss/beescms/blob/main/readme.md"
}
],
"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-6XV7-G282-FW95
Vulnerability from github – Published: 2025-03-19 18:30 – Updated: 2025-03-25 18:30An arbitrary file upload vulnerability in the component /views/plugin.php of emlog pro v2.5.7 allows attackers to execute arbitrary code via uploading a crafted PHP file.
{
"affected": [],
"aliases": [
"CVE-2025-29401"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-03-19T16:15:31Z",
"severity": "CRITICAL"
},
"details": "An arbitrary file upload vulnerability in the component /views/plugin.php of emlog pro v2.5.7 allows attackers to execute arbitrary code via uploading a crafted PHP file.",
"id": "GHSA-6xv7-g282-fw95",
"modified": "2025-03-25T18:30:53Z",
"published": "2025-03-19T18:30:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-29401"
},
{
"type": "WEB",
"url": "https://github.com/bGl1o/emlogpro/blob/main/emlog%20pro2.5.7-getshell.md"
}
],
"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-6XWR-CQXM-CH7R
Vulnerability from github – Published: 2022-05-01 18:30 – Updated: 2025-04-09 03:46Multiple PHP remote file inclusion vulnerabilities in dedi-group Der Dirigent 1.0 allow remote attackers to execute arbitrary PHP code via a URL in the dedi_path parameter to (1) inc.generate_code.php, (2) fnc.type_forms.php, or (3) fnc.type.php in backend/inc/, or (4) frontend.php or (5) backend.php in projekt01/cms/inc/; or (6) the this_dir parameter to backend/inc/class.filemanager.php. NOTE: vectors 4 and 5 are disputed by CVE because PHP encounters a fatal function-call error on a direct request for the file, before reaching the include statement.
{
"affected": [],
"aliases": [
"CVE-2007-5146"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-10-01T05:17:00Z",
"severity": "MODERATE"
},
"details": "Multiple PHP remote file inclusion vulnerabilities in dedi-group Der Dirigent 1.0 allow remote attackers to execute arbitrary PHP code via a URL in the dedi_path parameter to (1) inc.generate_code.php, (2) fnc.type_forms.php, or (3) fnc.type.php in backend/inc/, or (4) frontend.php or (5) backend.php in projekt01/cms/inc/; or (6) the this_dir parameter to backend/inc/class.filemanager.php. NOTE: vectors 4 and 5 are disputed by CVE because PHP encounters a fatal function-call error on a direct request for the file, before reaching the include statement.",
"id": "GHSA-6xwr-cqxm-ch7r",
"modified": "2025-04-09T03:46:44Z",
"published": "2022-05-01T18:30:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5146"
},
{
"type": "WEB",
"url": "http://arfis.wordpress.com/2007/09/14/rfi-02-der-dirigent"
},
{
"type": "WEB",
"url": "http://osvdb.org/45535"
},
{
"type": "WEB",
"url": "http://osvdb.org/45536"
},
{
"type": "WEB",
"url": "http://osvdb.org/45537"
},
{
"type": "WEB",
"url": "http://osvdb.org/45538"
},
{
"type": "WEB",
"url": "http://osvdb.org/45539"
},
{
"type": "WEB",
"url": "http://osvdb.org/45540"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-6XWW-7R57-HFP7
Vulnerability from github – Published: 2022-05-13 01:39 – Updated: 2022-05-13 01:39A certain ActiveX control in HPTicketMgr.dll in HP Easy Printer Care Software 2.5 and earlier allows remote attackers to download an arbitrary program onto a client machine, and execute this program, via unspecified vectors, a different vulnerability than CVE-2011-2404 and CVE-2011-4787.
{
"affected": [],
"aliases": [
"CVE-2011-4786"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-01-12T19:55:00Z",
"severity": "HIGH"
},
"details": "A certain ActiveX control in HPTicketMgr.dll in HP Easy Printer Care Software 2.5 and earlier allows remote attackers to download an arbitrary program onto a client machine, and execute this program, via unspecified vectors, a different vulnerability than CVE-2011-2404 and CVE-2011-4787.",
"id": "GHSA-6xww-7r57-hfp7",
"modified": "2022-05-13T01:39:25Z",
"published": "2022-05-13T01:39:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-4786"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2012-01/0078.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-722V-49RJ-HH57
Vulnerability from github – Published: 2023-08-02 09:32 – Updated: 2024-04-04 06:29An issue has been discovered in GitLab affecting all versions before 16.0.8, all versions starting from 16.1 before 16.1.3, all versions starting from 16.2 before 16.2.2. The main branch of a repository with a specially designed name allows an attacker to create repositories with malicious code.
{
"affected": [],
"aliases": [
"CVE-2023-3401"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-08-02T09:15:14Z",
"severity": "MODERATE"
},
"details": "An issue has been discovered in GitLab affecting all versions before 16.0.8, all versions starting from 16.1 before 16.1.3, all versions starting from 16.2 before 16.2.2. The main branch of a repository with a specially designed name allows an attacker to create repositories with malicious code.",
"id": "GHSA-722v-49rj-hh57",
"modified": "2024-04-04T06:29:34Z",
"published": "2023-08-02T09:32:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-3401"
},
{
"type": "WEB",
"url": "https://hackerone.com/reports/2031845"
},
{
"type": "WEB",
"url": "https://gitlab.com/gitlab-org/gitlab/-/issues/416252"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-7245-X6GQ-6QG5
Vulnerability from github – Published: 2024-04-08 06:31 – Updated: 2024-08-01 15:31An issue was discovered in CandyCMS version 1.0.0, allows remote attackers to execute arbitrary code via the install.php component.
{
"affected": [],
"aliases": [
"CVE-2024-31022"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-08T06:15:07Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in CandyCMS version 1.0.0, allows remote attackers to execute arbitrary code via the install.php component.",
"id": "GHSA-7245-x6gq-6qg5",
"modified": "2024-08-01T15:31:37Z",
"published": "2024-04-08T06:31:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-31022"
},
{
"type": "WEB",
"url": "https://www.xuxblog.top/2024/03/25/CandyCMS-Pre-Auth-RCE"
}
],
"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-7257-96VG-QF6X
Vulnerability from github – Published: 2020-08-21 17:03 – Updated: 2024-10-26 18:37Impact
A RCE exploit has been discovered in the Streams module: this exploit allows Discord users with specifically crafted "going live" messages to inject code into the Streams module's going live message. By abusing this exploit, it's possible to perform destructive actions and/or access sensitive information.
Patches
This critical exploit has been fixed on version 3.3.12 & 3.4.
Workarounds
Unloading the Streams module with unload streams can render this exploit not accessible. We still highly recommend updating to 3.3.12 or 3.4 to completely patch this issue.
References
- https://github.com/Cog-Creators/Red-DiscordBot/pull/4183
For more information
If you have any questions or comments about this advisory: * Open an issue in Cog-Creators/Red-DiscordBot * Over on our Discord server
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.3.11"
},
"package": {
"ecosystem": "PyPI",
"name": "Red-DiscordBot"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.3.12"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-15147"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-21T17:02:40Z",
"nvd_published_at": "2020-08-21T18:15:00Z",
"severity": "HIGH"
},
"details": "### Impact\nA RCE exploit has been discovered in the Streams module: this exploit allows Discord users with specifically crafted \"going live\" messages to inject code into the Streams module\u0027s going live message. By abusing this exploit, it\u0027s possible to perform destructive actions and/or access sensitive information.\n\n### Patches\nThis critical exploit has been fixed on version ``3.3.12`` \u0026 ``3.4``.\n\n### Workarounds\nUnloading the Streams module with ``unload streams`` can render this exploit not accessible. We still highly recommend updating to ``3.3.12`` or ``3.4`` to completely patch this issue.\n\n### References\n* https://github.com/Cog-Creators/Red-DiscordBot/pull/4183\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Cog-Creators/Red-DiscordBot](https://github.com/Cog-Creators/Red-DiscordBot)\n* Over on our [Discord server](https://discord.gg/red)",
"id": "GHSA-7257-96vg-qf6x",
"modified": "2024-10-26T18:37:01Z",
"published": "2020-08-21T17:03:24Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Cog-Creators/Red-DiscordBot/security/advisories/GHSA-7257-96vg-qf6x"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-15147"
},
{
"type": "WEB",
"url": "https://github.com/Cog-Creators/Red-DiscordBot/pull/4183"
},
{
"type": "WEB",
"url": "https://github.com/Cog-Creators/Red-DiscordBot/pull/4183/commits/e269ea0d3bc88417163c18431b1df38a9be92bfc"
},
{
"type": "WEB",
"url": "https://github.com/Cog-Creators/Red-DiscordBot"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/red-discordbot/PYSEC-2020-266.yaml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Remote Code Execution in Red Discord Bot"
}
GHSA-727G-3F42-FCRV
Vulnerability from github – Published: 2025-08-15 18:31 – Updated: 2025-08-15 18:31Improper Control of Generation of Code ('Code Injection') vulnerability in Wulkano KAP on MacOS allows TCC Bypass.This issue affects KAP: 3.6.0.
{
"affected": [],
"aliases": [
"CVE-2025-7961"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-08-15T17:15:32Z",
"severity": "MODERATE"
},
"details": "Improper Control of Generation of Code (\u0027Code Injection\u0027) vulnerability in Wulkano KAP on MacOS allows TCC Bypass.This issue affects KAP: 3.6.0.",
"id": "GHSA-727g-3f42-fcrv",
"modified": "2025-08-15T18:31:12Z",
"published": "2025-08-15T18:31:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-7961"
},
{
"type": "WEB",
"url": "https://fluidattacks.com/advisories/cafrune"
},
{
"type": "WEB",
"url": "https://getkap.co"
},
{
"type": "WEB",
"url": "https://github.com/wulkano/Kap"
},
{
"type": "WEB",
"url": "http://wulkano.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-728Q-F8MC-XGQ3
Vulnerability from github – Published: 2024-09-10 03:31 – Updated: 2024-09-10 03:31The Frontend Dashboard plugin for WordPress is vulnerable to unauthorized code execution due to insufficient filtering on callable methods/functions via the ajax_request() function in all versions up to, and including, 2.2.4. This makes it possible for authenticated attackers, with subscriber-level access and above, to call arbitrary functions that can be leverage for privilege escalation by changing user's passwords.
{
"affected": [],
"aliases": [
"CVE-2024-8268"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-09-10T03:15:03Z",
"severity": "HIGH"
},
"details": "The Frontend Dashboard plugin for WordPress is vulnerable to unauthorized code execution due to insufficient filtering on callable methods/functions via the ajax_request() function in all versions up to, and including, 2.2.4. This makes it possible for authenticated attackers, with subscriber-level access and above, to call arbitrary functions that can be leverage for privilege escalation by changing user\u0027s passwords.",
"id": "GHSA-728q-f8mc-xgq3",
"modified": "2024-09-10T03:31:32Z",
"published": "2024-09-10T03:31:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-8268"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/browser/frontend-dashboard/tags/2.2.4/route/class-fed-request.php#L29"
},
{
"type": "WEB",
"url": "https://plugins.trac.wordpress.org/changeset/3147868/frontend-dashboard/tags/2.2.5/route/class-fed-request.php?old=3048034\u0026old_path=frontend-dashboard%2Ftags%2F2.2.4%2Froute%2Fclass-fed-request.php"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/7d66694a-c99f-44f8-8004-1a47ad9f9250?source=cve"
}
],
"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"
}
]
}
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.