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.

8350 vulnerabilities reference this CWE, most recent first.

GHSA-3MPG-Q26J-83J5

Vulnerability from github – Published: 2023-01-21 03:30 – Updated: 2025-04-02 22:31
VLAI
Summary
Command injection in yiisoft/yii2-gii
Details

Yii Yii2 Gii before 2.2.2 allows remote attackers to execute arbitrary code via the Generator.php messageCategory field. The attacker can embed arbitrary PHP code into the model file.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "yiisoft/yii2-gii"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.2.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-36655"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-01-23T20:42:57Z",
    "nvd_published_at": "2023-01-21T01:15:00Z",
    "severity": "HIGH"
  },
  "details": "Yii Yii2 Gii before 2.2.2 allows remote attackers to execute arbitrary code via the Generator.php messageCategory field. The attacker can embed arbitrary PHP code into the model file.",
  "id": "GHSA-3mpg-q26j-83j5",
  "modified": "2025-04-02T22:31:52Z",
  "published": "2023-01-21T03:30:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-36655"
    },
    {
      "type": "WEB",
      "url": "https://github.com/yiisoft/yii2-gii/issues/433"
    },
    {
      "type": "WEB",
      "url": "https://github.com/yiisoft/yii2-gii/commit/ed61e0d85f43e23f79d7c9d1b4e5e5c09a32ce4b"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/yiisoft/yii2-gii"
    },
    {
      "type": "WEB",
      "url": "https://lab.wallarm.com/yii2-gii-remote-code-execution"
    }
  ],
  "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"
    }
  ],
  "summary": "Command injection in yiisoft/yii2-gii"
}

GHSA-3MPV-VC7V-XPC6

Vulnerability from github – Published: 2022-04-29 01:27 – Updated: 2022-04-29 01:27
VLAI
Details

ipchat.php in Invision Power Board 1.1.1 allows remote attackers to execute arbitrary PHP code, if register_globals is enabled, by modifying the root_path parameter to reference a URL on a remote web server that contains the code.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2003-1385"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2003-12-31T05:00:00Z",
    "severity": "MODERATE"
  },
  "details": "ipchat.php in Invision Power Board 1.1.1 allows remote attackers to execute arbitrary PHP code, if register_globals is enabled, by modifying the root_path parameter to reference a URL on a remote web server that contains the code.",
  "id": "GHSA-3mpv-vc7v-xpc6",
  "modified": "2022-04-29T01:27:59Z",
  "published": "2022-04-29T01:27:59Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2003-1385"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/11435"
    },
    {
      "type": "WEB",
      "url": "http://archives.neohapsis.com/archives/vulnwatch/2003-q1/0099.html"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/8182"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/3357"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/6976"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-3MXF-GMRF-P76M

Vulnerability from github – Published: 2022-05-24 17:11 – Updated: 2022-05-24 17:11
VLAI
Details

An issue was discovered in ONAP VNFSDK through Dublin. By accessing port 8000 of demo-vnfsdk-vnfsdk, an unauthenticated attacker (who already has access to pod-to-pod communication) may execute arbitrary code inside that pod. All ONAP Operations Manager (OOM) setups are affected.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2019-12120"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2020-03-18T19:15:00Z",
    "severity": "HIGH"
  },
  "details": "An issue was discovered in ONAP VNFSDK through Dublin. By accessing port 8000 of demo-vnfsdk-vnfsdk, an unauthenticated attacker (who already has access to pod-to-pod communication) may execute arbitrary code inside that pod. All ONAP Operations Manager (OOM) setups are affected.",
  "id": "GHSA-3mxf-gmrf-p76m",
  "modified": "2022-05-24T17:11:46Z",
  "published": "2022-05-24T17:11:46Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-12120"
    },
    {
      "type": "WEB",
      "url": "https://jira.onap.org/browse/OJSI-10"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-3MXV-473P-H624

Vulnerability from github – Published: 2024-04-19 18:31 – Updated: 2025-11-04 18:30
VLAI
Details

Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to execute arbitrary code via the libavfilter/avf_showwaves.c:722:24 in showwaves_filter_frame

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-51797"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-04-19T17:15:52Z",
    "severity": "MODERATE"
  },
  "details": "Buffer Overflow vulnerability in Ffmpeg v.N113007-g8d24a28d06 allows a local attacker to execute arbitrary code via the libavfilter/avf_showwaves.c:722:24 in showwaves_filter_frame",
  "id": "GHSA-3mxv-473p-h624",
  "modified": "2025-11-04T18:30:50Z",
  "published": "2024-04-19T18:31:15Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-51797"
    },
    {
      "type": "WEB",
      "url": "https://ffmpeg.org"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FFmpeg/FFmpeg"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6G7EYH2JAK5OJPVNC6AXYQ5K7YGYNCDN"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IPETICRXUOGRIM4U3BCRTIKE3IZWCSBT"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LE3ASLH6QF2E5OVJI5VA3JSEPJFFFMNY"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6G7EYH2JAK5OJPVNC6AXYQ5K7YGYNCDN"
    },
    {
      "type": "WEB",
      "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LE3ASLH6QF2E5OVJI5VA3JSEPJFFFMNY"
    },
    {
      "type": "WEB",
      "url": "https://trac.ffmpeg.org/ticket/10756"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-3P4P-6MRF-W5JM

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

Nibbleblog 4.0.5 allows eval injection by placing PHP code in the install.php username parameter and then making a content/private/shadow.php request.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2019-7719"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2019-02-11T04:29:00Z",
    "severity": "CRITICAL"
  },
  "details": "Nibbleblog 4.0.5 allows eval injection by placing PHP code in the install.php username parameter and then making a content/private/shadow.php request.",
  "id": "GHSA-3p4p-6mrf-w5jm",
  "modified": "2022-05-14T01:35:15Z",
  "published": "2022-05-14T01:35:15Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-7719"
    },
    {
      "type": "WEB",
      "url": "https://github.com/dignajar/nibbleblog/issues/138"
    }
  ],
  "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-3P7X-PG2Q-X6W8

Vulnerability from github – Published: 2022-05-17 03:59 – Updated: 2022-05-17 03:59
VLAI
Details

The Values module 7.x-1.x before 7.x-1.2 for Drupal does not properly check permissions, which allows remote administrators with the "Import value sets" permission to execute arbitrary PHP code via the exported values list in a ctools import.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2015-8761"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2016-01-08T19:59:00Z",
    "severity": "CRITICAL"
  },
  "details": "The Values module 7.x-1.x before 7.x-1.2 for Drupal does not properly check permissions, which allows remote administrators with the \"Import value sets\" permission to execute arbitrary PHP code via the exported values list in a ctools import.",
  "id": "GHSA-3p7x-pg2q-x6w8",
  "modified": "2022-05-17T03:59:51Z",
  "published": "2022-05-17T03:59:51Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2015-8761"
    },
    {
      "type": "WEB",
      "url": "https://www.drupal.org/node/2622534"
    },
    {
      "type": "WEB",
      "url": "https://www.drupal.org/node/2636344"
    },
    {
      "type": "WEB",
      "url": "http://cgit.drupalcode.org/values/commit/?id=5942ee9"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/79656"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-3P89-WGRC-2WM7

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

PHP remote file inclusion vulnerability in admin.a6mambocredits.php in the a6mambocredits component (com_a6mambocredits) 2.0.0 and earlier for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_live_site parameter. NOTE: some of these details are obtained from third party information.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2006-4288"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2006-08-22T17:04:00Z",
    "severity": "MODERATE"
  },
  "details": "PHP remote file inclusion vulnerability in admin.a6mambocredits.php in the a6mambocredits component (com_a6mambocredits) 2.0.0 and earlier for Mambo allows remote attackers to execute arbitrary PHP code via a URL in the mosConfig_live_site parameter.  NOTE: some of these details are obtained from third party information.",
  "id": "GHSA-3p89-wgrc-2wm7",
  "modified": "2022-05-01T07:17:09Z",
  "published": "2022-05-01T07:17:09Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2006-4288"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/28443"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/2207"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/21540"
    },
    {
      "type": "WEB",
      "url": "http://securitytracker.com/id?1016716"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/27991"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/19581"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2006/3311"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-3PG2-4QFR-5GQP

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

PHP remote file inclusion vulnerability in install/di.php in AjaxPortal 3.0 allows remote attackers to execute arbitrary PHP code via a URL in the pathtoserverdata parameter. NOTE: the installation instructions specify deleting the install/ folder.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2009-2262"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-06-30T10:30:00Z",
    "severity": "HIGH"
  },
  "details": "PHP remote file inclusion vulnerability in install/di.php in AjaxPortal 3.0 allows remote attackers to execute arbitrary PHP code via a URL in the pathtoserverdata parameter.  NOTE: the installation instructions specify deleting the install/ folder.",
  "id": "GHSA-3pg2-4qfr-5gqp",
  "modified": "2022-05-02T03:33:20Z",
  "published": "2022-05-02T03:33:20Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2009-2262"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/504618/100/0/threaded"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-3PJ4-6QW8-R7X8

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

Microsoft Forefront Unified Access Gateway (UAG) 2010 Gold, Update 1, Update 2, and SP1 provides the MicrosoftClient.jar file containing a signed Java applet, which allows remote attackers to execute arbitrary code on client machines via unspecified vectors, aka "Poisoned Cup of Code Execution Vulnerability."

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2011-1969"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2011-10-12T02:52:00Z",
    "severity": "HIGH"
  },
  "details": "Microsoft Forefront Unified Access Gateway (UAG) 2010 Gold, Update 1, Update 2, and SP1 provides the MicrosoftClient.jar file containing a signed Java applet, which allows remote attackers to execute arbitrary code on client machines via unspecified vectors, aka \"Poisoned Cup of Code Execution Vulnerability.\"",
  "id": "GHSA-3pj4-6qw8-r7x8",
  "modified": "2022-05-14T02:35:40Z",
  "published": "2022-05-14T02:35:40Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2011-1969"
    },
    {
      "type": "WEB",
      "url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2011/ms11-079"
    },
    {
      "type": "WEB",
      "url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A13032"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/49983"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-3PJG-H7VP-42P9

Vulnerability from github – Published: 2025-10-23 15:30 – Updated: 2025-10-23 18:31
VLAI
Details

A Host Header Injection vulnerability in the password reset component in axewater sharewarez v2.4.3 allows remote attackers to conduct password reset poisoning and account takeover via manipulation of the Host header when Flask's url_for(_external=True) generates reset links without a fixed SERVER_NAME.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-61136"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-10-23T15:15:44Z",
    "severity": "HIGH"
  },
  "details": "A Host Header Injection vulnerability in the password reset component in axewater sharewarez v2.4.3 allows remote attackers to conduct password reset poisoning and account takeover via manipulation of the Host header when Flask\u0027s url_for(_external=True) generates reset links without a fixed SERVER_NAME.",
  "id": "GHSA-3pjg-h7vp-42p9",
  "modified": "2025-10-23T18:31:14Z",
  "published": "2025-10-23T15:30:34Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-61136"
    },
    {
      "type": "WEB",
      "url": "https://drive.google.com/file/d/15X5L1uEqgWOLrjKqm96cEPAWp2ph0zJp/view?usp=sharing"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/BrookeYangRui/145e529b5fd4f56af299efde37edf4fa"
    },
    {
      "type": "WEB",
      "url": "https://github.com/axewater/sharewarez/blob/d04c90b7dc3fbae1596f731d1b168d3fb9fdd2df/modules/routes_login.py#L188-L217"
    },
    {
      "type": "WEB",
      "url": "https://github.com/axewater/sharewarez/blob/d04c90b7dc3fbae1596f731d1b168d3fb9fdd2df/modules/utils_smtp.py#L191-L206"
    },
    {
      "type": "WEB",
      "url": "https://portswigger.net/web-security/host-header/exploiting/password-reset-poisoning"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/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.