Skip to content
OpenAdvisories

Weakness (CWE)

CWE-94: Improper Control of Generation of Code

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

How to prevent it (7 mitigations)
  1. Architecture and Design

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

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

  3. Implementation

    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().

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

  5. Operation

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

  6. Operation

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

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

Source: MITRE CWE-94

5,297 results · Feed

  • High 8.1

    picklescan - Arbitrary Code Execution via numpy.f2py.crackfortran.myeval Detection Bypass

    picklescan before 0.0.33 fails to detect malicious pickle files that invoke numpy.f2py.crackfortran.myeval function through the reduce method. Attackers can craft malicious pickle files embedding arbitrary code that evades picklescan detection and executes re…

  • Critical 9.8

    expr-eval vulnerable to Code Execution

    All versions of the package expr-eval are vulnerable to Code Execution via the toJSFunction() API. An attacker can execute arbitrary JavaScript by supplying crafted expressions that are compiled into native code using new Function(). Because user-controlled e…

  • High 7.5

    vLLM: Security Check Bypass via assert Statement in Activation Function Loading Allows Arbitrary Code Execution

    vLLM is an inference and serving engine for large language models (LLMs). Prior to 0.22.0, an assert-based security check in vLLM's activation function loading allows any unauthenticated attacker to achieve arbitrary code execution on the server by publishing…

  • High 8.1

    Picklescan - Arbitrary Code Execution via numpy.f2py.crackfortran._eval_length Gadget

    Picklescan before 0.0.33 fails to detect the numpy.f2py.crackfortran._eval_length gadget in pickle __reduce__ methods, allowing arbitrary code execution. Attackers can craft malicious pickle files that execute arbitrary Python code when loaded by victims who …

  • Critical 9.6

    MCP Extension Code Injection Vulnerability in Autodesk Fusion Desktop

    A maliciously crafted webpage, when visited by a user with Autodesk Fusion Desktop running and the MCP extension enabled, can trigger a vulnerability in the MCP extension that could allow arbitrary code execution. A successful exploit may allow code to execut…

  • High 8.1

    piscina: Prototype Pollution Gadget → RCE via inherited options.filename

    piscina is a node.js worker pool implementation. Prior to 6.0.0-rc.2, 5.2.0, and 4.9.3, piscina's constructor and run() paths read the filename option via plain member access. Both reads fall through the prototype chain when the caller's options object doesn'…

  • High 8.2

    protobufjs-cli: Code injection in pbjs static output from crafted JSON descriptor names

    protobufjs-cli is the command line add-on for protobuf.js. Prior to 1.3.2 and 2.5.0, a previous fix for unsafe name handling in pbjs static / static-module code generation was incomplete. Affected versions of protobufjs-cli could still emit unsafe JavaScript …

  • High 8.7

    Angular: Remote Code Execution via JSDoc Hover Command Injection in VS Code Angular Language Service Extension

    The Angular Language Service VS Code Extension provides a rich editing experience for Angular templates. the client-side Angular Language Service VS Code extension configures the tooltip Markdown renderer with the isTrusted: true option (located in client/src…

  • High 8.7

    Angular: Multiple Remote Code Execution Vulnerabilities in Angular Language Service VS Code Extension

    The Angular Language Service VS Code Extension provides a rich editing experience for Angular templates. Prior to 21.2.4, the client-side Angular Language Service VS Code extension reads the custom TypeScript SDK paths typescript.tsdk and js/ts.tsdk.path dire…

  • High 8.1

    WebSphere Application Server Remote Code Execution

    IBM WebSphere Application Server and IBM WebSphere Application Server Liberty - when using Intelligent Management with the WebSphere WebServer Plug-in component - are vulnerable to remote code execution and denial of service. This vulnerability can be exploit…

  • High 7.5

    WebSphere Application Server Remote Code Execution

    IBM WebSphere Application Server and IBM WebSphere Application Server Liberty are vulnerable to remote code execution and denial of service in the WebSphere Web Server Plug-in component. This vulnerability can be exploited when an attacker impersonates the ap…

  • Critical 10.0

    Unauthenticated Remote Code Execution in Langflow OSS PythonREPLComponent via Builtins Injection

    IBM Langflow OSS 1.0.0 through 1.9.3 has an vulnerability due to an improper isolation of Python execution combined with an authentication bypass that allows an unauthenticated attacker to execute arbitrary code on the host system, resulting in complete compr…

  • High 8.7

    Authenticated Remote Code Execution via Arbitrary NDJSON Error Log Path in MISP

    MISP allowed a site administrator to configure an arbitrary filesystem path for the NDJSON error log used by JsonLogTool. Because log entries can include attacker-controlled content, an authenticated attacker with site administrator privileges could direct lo…

  • Medium 5.3

    langflow-ai langflow Bundle URL Loader code injection

    A vulnerability was identified in langflow-ai langflow up to 1.9.3. This affects an unknown function of the component Bundle URL Loader. The manipulation leads to code injection. The attack needs to be performed locally. The vendor was contacted early about t…

  • Medium 4.3

    kortix-ai suna Auth Endpoint page.tsx router.push cross site scripting

    A weakness has been identified in kortix-ai suna up to 0.8.38. Affected by this issue is the function router.replace/router.push of the file apps/frontend/src/app/auth/page.tsx of the component Auth Endpoint. Executing a manipulation of the argument returnURL…

  • High 7.2

    Craft CMS - Remote Code Execution via Missing Config Sanitization in FieldsController

    Craft CMS (composer package craftcms/cms) versions >= 5.5.0 and <= 5.9.13 contain a remote code execution vulnerability in the FieldsController::actionRenderCardPreview() method, which passes the fieldLayoutConfig POST parameter directly to Fields::createLayo…

  • Critical 9.9
    CVE-2026-5366 Public exploit

    Git Argument Injection in prefecthq/prefect

    Prefect version 3.6.23 is vulnerable to remote code execution due to improper handling of user-controlled input in the `GitRepository` storage class. The `commit_sha` parameter, which is passed to git commands, lacks validation and does not include a `--` sep…

  • Critical 9.8

    Flowise - Remote Code Execution via overrideConfig Parameter

    Flowise before 2.1.4 allows configuration to be injected into the Chainflow during execution via the overrideConfig option, supported in both the frontend web integration and the backend Prediction API. Because this feature is enabled by default with no allow…

  • Critical 9.8

    WooCommerce 7.1.0 Remote Code Execution via class-wc-meta-box-product-images.php

    WooCommerce 7.1.0 contains a remote code execution vulnerability that allows attackers to execute arbitrary PHP code by injecting shell commands through the product-type parameter. Attackers can send requests to the class-wc-meta-box-product-images.php endpoi…

  • High 7.5

    WordPress Advanced Ads plugin <= 2.0.21 - Remote Code Execution (RCE) vulnerability

    Improper Control of Generation of Code ('Code Injection') vulnerability in Monetizemore Advanced Ads allows Remote Code Inclusion. This issue affects Advanced Ads: from n/a through 2.0.21.

  • Critical 9.9

    WordPress Blocksy Companion Pro plugin <= 2.1.37 - Remote Code Execution (RCE) vulnerability

    Contributor Remote Code Execution (RCE) in Blocksy Companion Pro <= 2.1.37 versions.

  • Critical 9.1

    JimuReport versions 2.3.4 and below are vulnerable to remote code execution due to improper handling of Aviator express…

  • Critical 10.0

    WordPress ACPT (Pro) - Custom Post Types plugin for WordPress plugin < 2.0.52 - Remote Code Execution (RCE) vulnerability

    Unauthenticated Remote Code Execution (RCE) in ACPT (Pro) - Custom Post Types Plugin for WordPress <= 2.0.47 versions.

  • High 8.5

    WordPress Cornerstone plugin < 7.8.8 - Arbitrary Code Execution vulnerability

    Subscriber Arbitrary Code Execution in Cornerstone < 7.8.8 versions.

  • High 8.1

    Vulnerability in the PeopleSoft Enterprise CS Campus Community product of Oracle PeopleSoft (component: Security). The …

  • Critical 9.9

    Vulnerability in the MySQL Shell product of Oracle MySQL (component: Shell for VS Code). The supported version that is …

  • High 7.8

    NVIDIA NeMo Framework for all platforms contains a code injection vulnerability. A successful exploit of this vulnerabi…

  • Critical 9.9

    WordPress RD Station plugin <= 5.6.0 - Remote Code Execution (RCE) vulnerability

    Improper Control of Generation of Code ('Code Injection') vulnerability in Filipe Nasc RD Station allows Remote Code Inclusion. This issue affects RD Station: from n/a through 5.6.0.

  • High 8.8
    CVE-2026-48017 Public exploit

    DbGate: Remote Code Execution via functionName injection in loadReader endpoint

    DbGate is cross-platform database manager. In versions 7.1.8 and prior, the POST /runners/load-reader endpoint in DbGate accepts a functionName parameter that is directly interpolated into a JavaScript code template without any sanitization or validation. An …

  • Critical 10.0

    WordPress Easy Invoice plugin <= 2.1.19 - Remote Code Execution (RCE) vulnerability

    Unauthenticated Remote Code Execution (RCE) in Easy Invoice <= 2.1.19 versions.

  • Critical 9.1

    WordPress Responsive Slider by MetaSlider plugin <= 3.106.0 - Remote Code Execution (RCE) vulnerability

    Editor Remote Code Execution (RCE) in Responsive Slider by MetaSlider <= 3.106.0 versions.

  • High 8.5

    Cursor Desktop sandbox escape via Claude hook configuration

    Cursor is a code editor built for programming with AI. In versions prior to 3.0.0, the Cursor Desktop could execute workspace-defined Claude hook commands from .claude/settings.local.json without dedicated user approval. A malicious workspace or agent-created…

  • Critical 10.0

    WordPress WooCommerce PDF Invoice Builder plugin <= 2.0.8 - Remote Code Execution (RCE) vulnerability

    Improper Control of Generation of Code ('Code Injection') vulnerability in Edgar Rojas WooCommerce PDF Invoice Builder allows Remote Code Inclusion. This issue affects WooCommerce PDF Invoice Builder: from n/a through 2.0.8.

  • High 7.5

    Insecure Deserialisation via Plaintext HTTP leading to Remote Code Execution in Quick.CMS

    Quick.CMS deserializes user-controlled data received over plaintext HTTP without ensuring integrity or authenticity. This allows attackers to tamper with serialized payloads in transit and inject malicious objects. Because deserialization is performed without…

  • Medium 5.3

    RubyLouvre avalon Template Filter index.js prototype pollution

    A security vulnerability has been detected in RubyLouvre avalon up to 2.2.10. The impacted element is an unknown function of the file src/filters/index.js of the component Template Filter Handler. Such manipulation leads to improperly controlled modification …

  • Medium 5.3

    jsonata-js jsonata Function Binding Frame System jsonata.js createFrame prototype pollution

    A weakness has been identified in jsonata-js jsonata up to 2.2.0. The affected element is the function createFrame of the file src/jsonata.js of the component Function Binding Frame System. This manipulation causes improperly controlled modification of object…

  • Low 2.4

    Intelliants Subrion CMS Blocks Endpoint cross site scripting

    A vulnerability has been found in Intelliants Subrion CMS up to 4.0.3. Affected by this issue is some unknown functionality of the component Blocks Endpoint. Such manipulation of the argument CSS class name leads to cross site scripting. The attack may be lau…

  • Critical 9.8

    YouTransfer has an issue in the sendmail transport integration that allows arbitrary code execution

    An issue in the sendmail transport integration component of YouTransfer v1.0.6 allows attackers to execute arbitrary code via supplying a crafted request.

  • Critical 9.8

    An issue in the loopback request handling component of fossar selfoss v2.20-SNAPSHOT allows attackers to execute arbitr…

  • Critical 9.8

    An OS command injection vulnerability in the media archiving and export pipeline component of kanishka-linux Reminiscen…