Common Weakness Enumeration

CWE-94

Allowed-with-Review

Improper 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.

8378 vulnerabilities reference this CWE, most recent first.

GHSA-PC79-P3CX-HCJP

Vulnerability from github – Published: 2025-10-31 00:30 – Updated: 2025-11-06 18:32
VLAI
Details

Nagios Log Server versions prior to 2024R1.3.1 contain a code injection vulnerability where malformed dashboard ID values are not properly validated before being forwarded to an internal API. An attacker able to supply crafted dashboard ID values can cause the system to execute attacker-controlled data, leading to arbitrary code execution in the context of the Log Server process.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-34277"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-10-30T22:15:48Z",
    "severity": "CRITICAL"
  },
  "details": "Nagios Log Server versions prior to\u00a02024R1.3.1 contain a code injection vulnerability where\u00a0malformed dashboard ID values are not properly validated before being forwarded to an internal API.\u00a0An attacker able to supply crafted dashboard ID values can cause the system to execute attacker-controlled data, leading to arbitrary code execution in the context of the Log Server process.",
  "id": "GHSA-pc79-p3cx-hcjp",
  "modified": "2025-11-06T18:32:48Z",
  "published": "2025-10-31T00:30:34Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-34277"
    },
    {
      "type": "WEB",
      "url": "https://www.nagios.com/changelog/#log-server-2024R1"
    },
    {
      "type": "WEB",
      "url": "https://www.nagios.com/products/security/#log-server"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/nagios-log-server-rce-via-malformed-dashboard-id"
    }
  ],
  "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"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/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-PC7W-54Q4-2CX9

Vulnerability from github – Published: 2022-05-01 07:01 – Updated: 2022-05-01 07:01
VLAI
Details

PHP remote file inclusion vulnerability in SocketMail Lite and Pro 2.2.6 and earlier, when register_globals and magic_quotes are enabled, allows remote attackers to execute arbitrary PHP code via a URL in the site_path parameter to (1) index.php and (2) inc-common.php.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2006-2681"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2006-05-31T10:06:00Z",
    "severity": "MODERATE"
  },
  "details": "PHP remote file inclusion vulnerability in SocketMail Lite and Pro 2.2.6 and earlier, when register_globals and magic_quotes are enabled, allows remote attackers to execute arbitrary PHP code via a URL in the site_path parameter to (1) index.php and (2) inc-common.php.",
  "id": "GHSA-pc7w-54q4-2cx9",
  "modified": "2022-05-01T07:01:23Z",
  "published": "2022-05-01T07:01:23Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2006-2681"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/26693"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/20273"
    },
    {
      "type": "WEB",
      "url": "http://securitytracker.com/id?1016228"
    },
    {
      "type": "WEB",
      "url": "http://www.majorsecurity.de/advisory/major_rls6.txt"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2006/1976"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PC7W-VV76-8CV4

Vulnerability from github – Published: 2022-05-05 02:48 – Updated: 2022-05-05 02:48
VLAI
Details

The smart proxy Puppet run API in Foreman before 1.2.0 allows remote attackers to execute arbitrary commands via vectors related to escaping and Puppet commands.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2013-0210"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2014-05-08T14:29:00Z",
    "severity": "HIGH"
  },
  "details": "The smart proxy Puppet run API in Foreman before 1.2.0 allows remote attackers to execute arbitrary commands via vectors related to escaping and Puppet commands.",
  "id": "GHSA-pc7w-vv76-8cv4",
  "modified": "2022-05-05T02:48:35Z",
  "published": "2022-05-05T02:48:35Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2013-0210"
    },
    {
      "type": "WEB",
      "url": "http://theforeman.org/security.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PC82-H94J-GHV6

Vulnerability from github – Published: 2022-05-17 00:46 – Updated: 2022-05-17 00:46
VLAI
Details

PHP remote file inclusion vulnerability in cms/classes/openengine/filepool.php in openEngine 2.0 beta2, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the oe_classpath parameter, a different vector than CVE-2008-4329.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-4719"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-10-23T20:00:00Z",
    "severity": "HIGH"
  },
  "details": "PHP remote file inclusion vulnerability in cms/classes/openengine/filepool.php in openEngine 2.0 beta2, when register_globals is enabled, allows remote attackers to execute arbitrary PHP code via a URL in the oe_classpath parameter, a different vector than CVE-2008-4329.",
  "id": "GHSA-pc82-h94j-ghv6",
  "modified": "2022-05-17T00:46:42Z",
  "published": "2022-05-17T00:46:42Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4719"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45482"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/6585"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/4478"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/31423"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PC8H-5QFP-98RQ

Vulnerability from github – Published: 2022-05-14 01:53 – Updated: 2022-05-14 01:53
VLAI
Details

MiniCMS 1.10 allows execution of arbitrary PHP code via the install.php sitename parameter, which affects the site_name field in mc_conf.php.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2018-18892"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2018-11-01T01:29:00Z",
    "severity": "CRITICAL"
  },
  "details": "MiniCMS 1.10 allows execution of arbitrary PHP code via the install.php sitename parameter, which affects the site_name field in mc_conf.php.",
  "id": "GHSA-pc8h-5qfp-98rq",
  "modified": "2022-05-14T01:53:44Z",
  "published": "2022-05-14T01:53:44Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-18892"
    },
    {
      "type": "WEB",
      "url": "https://github.com/AvaterXXX/MiniCms/blob/master/Command%20Execution.md"
    },
    {
      "type": "WEB",
      "url": "https://www.patec.cn/newsshow.php?cid=24\u0026id=135"
    }
  ],
  "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-PC8Q-CGFC-WW4J

Vulnerability from github – Published: 2022-05-01 18:26 – Updated: 2022-05-01 18:26
VLAI
Details

PHP remote file inclusion vulnerability in index.php in eNetman 1 allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2007-4712"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2007-09-05T19:17:00Z",
    "severity": "HIGH"
  },
  "details": "PHP remote file inclusion vulnerability in index.php in eNetman 1 allows remote attackers to execute arbitrary PHP code via a URL in the page parameter.",
  "id": "GHSA-pc8q-cgfc-ww4j",
  "modified": "2022-05-01T18:26:28Z",
  "published": "2022-05-01T18:26:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4712"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36418"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/4356"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/26656"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/36806"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/25527"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2007/3091"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PCCC-HMR2-V337

Vulnerability from github – Published: 2022-05-01 07:08 – Updated: 2022-05-01 07:08
VLAI
Details

PHP remote file inclusion vulnerability in galleria.html.php in Galleria Mambo Module 1.0 and earlier for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2006-3396"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2006-07-06T20:05:00Z",
    "severity": "MODERATE"
  },
  "details": "PHP remote file inclusion vulnerability in galleria.html.php in Galleria Mambo Module 1.0 and earlier for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_absolute_path parameter.",
  "id": "GHSA-pccc-hmr2-v337",
  "modified": "2022-05-01T07:08:43Z",
  "published": "2022-05-01T07:08:43Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2006-3396"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/27528"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/1981"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/20949"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/1197"
    },
    {
      "type": "WEB",
      "url": "http://securitytracker.com/id?1016437"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/27010"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/439035/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/439624/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/18808"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2006/2666"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PCCM-7W72-QQQC

Vulnerability from github – Published: 2022-05-01 18:28 – Updated: 2022-05-01 18:28
VLAI
Details

PHP remote file inclusion vulnerability in admin.joom12pic.php in the joom12Pic (com_joom12pic) 1.0 component for Joomla! allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_live_site parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2007-4954"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2007-09-18T20:17:00Z",
    "severity": "MODERATE"
  },
  "details": "PHP remote file inclusion vulnerability in admin.joom12pic.php in the joom12Pic (com_joom12pic) 1.0 component for Joomla! allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_live_site parameter.",
  "id": "GHSA-pccm-7w72-qqqc",
  "modified": "2022-05-01T18:28:39Z",
  "published": "2022-05-01T18:28:39Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4954"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36639"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/4416"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/26849"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/25691"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PCG6-P3V7-QGR9

Vulnerability from github – Published: 2022-05-01 18:41 – Updated: 2022-05-01 18:41
VLAI
Details

SquirrelMail 1.4.11 and 1.4.12, as distributed on sourceforge.net before 20071213, has been externally modified to create a Trojan Horse that introduces a PHP remote file inclusion vulnerability, which allows remote attackers to execute arbitrary code.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2007-6348"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2007-12-14T19:46:00Z",
    "severity": "MODERATE"
  },
  "details": "SquirrelMail 1.4.11 and 1.4.12, as distributed on sourceforge.net before 20071213, has been externally modified to create a Trojan Horse that introduces a PHP remote file inclusion vulnerability, which allows remote attackers to execute arbitrary code.",
  "id": "GHSA-pcg6-p3v7-qgr9",
  "modified": "2022-05-01T18:41:59Z",
  "published": "2022-05-01T18:41:59Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2007-6348"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=bugtraq\u0026m=119765643909825\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=squirrelmail-devel\u0026m=119756462212214\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=squirrelmail-devel\u0026m=119765235203392\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://osvdb.org/42633"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28095"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/485037/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.squirrelmail.org/index.php"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-PCHW-X6HV-9CVJ

Vulnerability from github – Published: 2021-12-15 00:00 – Updated: 2022-07-13 00:01
VLAI
Details

Two methods of a utility class in SAP NetWeaver AS ABAP - versions 700, 701, 702, 710, 711, 730, 731, 740, 750, 751, 752, 753, 754, 755, 756, allow an attacker with high privileges and has direct access to SAP System, to inject code when executing with a certain transaction class builder. This could allow execution of arbitrary commands on the operating system, that could highly impact the Confidentiality, Integrity and Availability of the system.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-44235"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-78",
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-12-14T16:15:00Z",
    "severity": "HIGH"
  },
  "details": "Two methods of a utility class in SAP NetWeaver AS ABAP - versions 700, 701, 702, 710, 711, 730, 731, 740, 750, 751, 752, 753, 754, 755, 756, allow an attacker with high privileges and has direct access to SAP System, to inject code when executing with a certain transaction class builder. This could allow execution of arbitrary commands on the operating system, that could highly impact the Confidentiality, Integrity and Availability of the system.",
  "id": "GHSA-pchw-x6hv-9cvj",
  "modified": "2022-07-13T00:01:49Z",
  "published": "2021-12-15T00:00:43Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-44235"
    },
    {
      "type": "WEB",
      "url": "https://launchpad.support.sap.com/#/notes/3123196"
    },
    {
      "type": "WEB",
      "url": "https://wiki.scn.sap.com/wiki/display/PSR/SAP+Security+Patch+Day+-+December+2021"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation
Architecture and Design

Strategy: Refactoring

Refactor your program so that you do not have to dynamically generate code.

Mitigation
Architecture and Design
  • 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
Implementation

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
Testing

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
Operation

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
Operation

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
Implementation

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.