Skip to content
OpenAdvisories

Weakness (CWE)

CWE-78: OS Command Injection

Base Improper Neutralization of Special Elements used in an OS Command

The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command before it is sent to a downstream component.

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

    If at all possible, use library calls rather than external processes to recreate the desired functionality.

  2. Architecture and Design, Operation

    Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.

    OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.

    This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.

    Be careful to avoid CWE-243 and other weaknesses related to jails.

  3. Architecture and Design

    For any data that will be used to generate a command to be executed, keep as much of that data out of external control as possible. For example, in web applications, this may require storing the data locally in the session's state instead of sending it out to the client in a hidden form field.

  4. Architecture and Design

    For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

  5. Architecture and Design

    Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

    For example, consider using the ESAPI Encoding control [REF-45] or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error.

  6. Implementation

    While it is risky to use dynamically-generated query strings, code, or commands that mix control and data together, sometimes it may be unavoidable. Properly quote arguments and escape any special characters within those arguments. The most conservative approach is to escape or filter all characters that do not pass an extremely strict allowlist (such as everything that is not alphanumeric or white space). If some special characters are still needed, such as white space, wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection (CWE-88).

  7. Implementation

    If the program to be executed allows arguments to be specified within an input file or from standard input, then consider using that mode to pass arguments instead of the command line.

  8. Architecture and Design

    If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.

    Some languages offer multiple functions that can be used to invoke commands. Where possible, identify any function that invokes a command shell using a single string, and replace it with a function that requires individual arguments. These functions typically perform appropriate quoting and filtering of arguments. For example, in C, the system() function accepts a string that contains the entire command to be executed, whereas execl(), execve(), and others require an array of strings, one for each argument. In Windows, CreateProcess() only accepts one command at a time. In Perl, if system() is provided with an array of arguments, then it will quote each of the arguments.

Source: MITRE CWE-78

5,327 results · Feed

  • Critical 9.9
    CVE-2026-9645 Public exploit

    ScadaBR Authenticated Remote Code Execution

    Exposed methods allow authenticated users to create and execute arbitrary JavaScript code on the server. The scripts execute with full access, enabling complete system compromise as commands are executed as root.

  • High 8.6

    Zed: Allowlist Bypass via Bash Arithmetic Expansion in Terminal Tool Permissions

    Zed is a code editor. Prior to 0.229.0, Zed's terminal tool permission system can be bypassed via bash arithmetic expansion $((...)), allowing execution of arbitrary commands nested inside an allowlisted command like echo. This vulnerability is fixed in 0.229…

  • High 8.6

    Zed: Allowlist Bypass via Environment Variable Injection in Terminal Tool Permissions

    Zed is a code editor. Prior to 0.229.0, Zed's terminal tool permission system can be bypassed by prepending environment variable assignments to allowlisted commands, hijacking program behavior (e.g., PAGER) to execute arbitrary code. This vulnerability is fix…

  • High 8.6

    Zed: Zed IDE Arbitrary Code Execution via untrusted repository with poisoned .git/config

    Zed is a code editor. Prior to 0.227.1, Zed IDE executes arbitrary commands when opening a folder with a malicious .git/config file that abuses the core.fsmonitor Git configuration option. This allows an attacker to achieve Remote Code Execution (RCE) when a …

  • High 8.6

    Zed: Remote Command Injection via Unquoted Environment Variable Keys (SSH / WSL Remote)

    Zed is a code editor. Prior to 0.227.1, Zed builds SSH/WSL remote commands as a shell command string that starts with exec env ..., but environment variable keys are inserted without shell quoting or validation. If an attacker can control an environment varia…

  • Critical 9.0
    CVE-2026-4408 Public exploit EPSS 47%

    Samba: remote code execution in samr

    A flaw was found in Samba. A remote attacker can exploit a misconfiguration in Samba file servers and classic domain controllers that use the "check password script" feature. If this script is configured with the %u substitution character, the client-controll…

  • High 7.0

    Rpm: command injection in rpmuncompress dountar() via unescaped archive top-level directory name in popen() shell command

    A command injection vulnerability was discovered in the `rpmuncompress` utility of RPM. When extracting certain archive formats (ZIP, 7z, GEM) to a specified destination directory, the tool inserts the archive's top-level folder name into a shell command with…

  • High 7.8

    OS Command Injection in Microsoft UFO Shell Action Replay via Stored Session JSON

    Microsoft UFO open-source framework for intelligent automation across devices and platforms. Microsoft UFO tagged releases up to and including v3.0.0 contain an OS command injection vulnerability in the shell action replay path. In affected releases, ShellRec…

  • High 7.8

    uniget: Command Injection in tool.Check Leading to Arbitrary Code Execution

    uniget is a universal installer and updater for (container) tools. Prior to 0.27.1, a command injection vulnerability exists in uniget due to unsafe execution of the check field from metadata files using /bin/bash -c. Because the check field is loaded directl…

  • High 8.8

    Tanium addressed an unauthorized code execution vulnerability in Connect.

    Tanium addressed an unauthorized code execution vulnerability in Connect.

  • High 8.6

    claude-code-cache-fix: Local code execution via Python triple-quote injection in tools/quota-statusline.sh

    claude-code-cache-fix is a cache optimization proxy for Claude Code. From 3.5.0 to before 3.5.2, tools/quota-statusline.sh (introduced in v3.5.0) interpolates Claude Code's hook stdin payload directly into a Python triple-quoted string literal. A ''' byte seq…

  • High 8.2

    pam_usb: Shell injection via device UUID and username in pamusb-conf and pamusb-agent

    pam_usb provides hardware authentication for Linux using ordinary removable media. Prior to 0.8.7, a crafted UUID such as $(id>/tmp/rce) in the config causes root RCE when pamusb-conf --reset-pads is run. A USB device with a crafted filesystem UUID (some cont…

  • High 7.8

    pam_usb: PINENTRY_FALLBACK_APP environment variable allows arbitrary command execution

    pam_usb provides hardware authentication for Linux using ordinary removable media. Prior to 0.8.7, pamusb-pinentry reads the PINENTRY_FALLBACK_APP environment variable and executes it directly without any validation. Any process that can set environment varia…

  • High 8.8

    pam_usb: Command injection via $TMUX environment variable leads to RCE as root

    pam_usb provides hardware authentication for Linux using ordinary removable media. Prior to 0.8.7, src/tmux.c reads the user's $TMUX environment variable, splits it on commas, and interpolates the socket-path component directly into a shell command passed to …

  • High 7.8

    systeminformation: Linux command injection in networkInterfaces() via unsanitized NetworkManager connection profile name

    systeminformation is a System and OS information library for node.js. From 4.17.0 to 5.31.5, on Linux, systeminformation is vulnerable to command injection in networkInterfaces() when an active NetworkManager connection profile name contains shell metacharact…

  • Critical 9.3
    CVE-2026-44590 Public exploit

    Sherlock: Command Injection via pull_request_target in validate_modified_targets.yml

    Sherlock hunts down social media accounts by username across social networks. Prior to 0.16.1, the GitHub Actions workflow validate_modified_targets.yml is vulnerable to command injection via the pull_request_target trigger. Any GitHub user can execute arbitr…

  • Critical 10.0
    CVE-2026-45087 Public exploit

    Dalfox: Unauthenticated Remote Code Execution via `found-action` in Dalfox Server Mode

    Dalfox is a powerful open-source XSS scanner and utility focused on automation. Prior to 2.13.0, when dalfox is started in REST API server mode (dalfox server), the server binds to 0.0.0.0:6664 by default and requires no API key unless the operator explicitly…

  • High 8.8

    BentoML: Dockerfile command injection via docker.base_image

    BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Prior to 1.4.39, src/bentoml/_internal/container/frontend/dockerfile/templates/base_v2.j2 interpolates docker.base_image raw with no escaping, newline f…

  • High 8.8

    BentoML: Dockerfile command injection via envs[*].name in bentofile.yaml

    BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Prior to 1.4.39, a malicious bentofile.yaml containing a newline-injected value in envs[*].name produces unquoted RUN directives in the BentoML-generate…

  • High 7.2

    Command injection via malicious configuration

    A highly authenticated attacker can alter the config generator injecting a payload into future created configurations. The device is not correctly checking this configuration value before passing it to an system execute leading to code execution. This can res…

  • Critical 9.1

    HTTP::Daemon versions before 6.17 for Perl allow OS command injection via send_file()

    HTTP::Daemon versions before 6.17 for Perl allow OS command injection via send_file(). send_file() opens its string argument with Perl's 2-arg open(). The 2-arg form interprets magic prefixes: '| cmd' and 'cmd |' open a pipe to a subprocess, '> path' and '>> …

  • High 8.8

    Tanium addressed an unauthorized code execution vulnerability in Connect.

    Tanium addressed an unauthorized code execution vulnerability in Connect.

  • High 8.8

    @pensar/apex <= 0.0.58 is vulnerable to OS command injection via the smart_enumerate tool. The createSmartEnumerateTool…

  • High 7.3

    picoclaw is vulnerable to OS command injection via the ExecTool component

    picoclaw <=v0.1.2 and earlier is vulnerable to OS command injection via the ExecTool component (pkg/tools/shell.go). The guardCommand() function attempts to restrict shell command execution using a denylist of 8 regular expressions, but the denylist is incomp…

  • Critical 9.1

    Lumiverse: Spindle extension install runs untrusted lifecycle scripts before security scan

    Lumiverse is a full-featured AI chat application. Prior to 0.9.7, the Spindle extension build pipeline calls bun install without the --ignore-scripts flag before running the static backend safety scan (assertSafeBackendBundle). A malicious extension that ship…

  • High 8.9
    CVE-2026-9560 Public exploit

    Privilege escalation via background service of OpenVPN Connect 3.5.1 through 3.8.1 on macOS allows attackers to execute…

  • Critical 9.9

    Twenty: SQL Injection via the timeZone field

    Twenty is an open source CRM. From 1.7.7 through 1.16.7, a critical Remote Code Execution (RCE) vulnerability exists in Twenty CRM via a chained SQL Injection and PostgreSQL COPY TO PROGRAM attack. If Postgres user is a super user then any authenticated user …

  • Medium 6.3

    haojing8312 WorkClaw Blacklist bash.rs is_dangerous os command injection

    A vulnerability was determined in haojing8312 WorkClaw up to 0.6.4. This affects the function is_dangerous of the file apps/runtime/src-tauri/src/agent/tools/bash.rs of the component Blacklist Handler. Executing a manipulation can lead to os command injection…

  • Medium 5.0

    Vowpal Wabbit: Shell injection via crafted PR title in python_checks.yml allows arbitrary command execution on CI runner

    Vowpal Wabbit is a machine learning system. The workflow .github/workflows/python_checks.yml embeds ${{ github.event.pull_request.title }} directly inside double-quoted bash strings in four separate steps across four jobs, each passing it as a CLI argument to…

  • Critical 9.0
    CVE-2026-4480 Public exploit Scanner template EPSS 29%

    Samba: samba: remote code execution in printing subsystem via unescaped job description

    A flaw was found in the Samba printing subsystem. Samba passes the client-controlled job description string to the command configured with the "print command" setting via the "%J" substitution character without escaping shell meta characters. A remote attacke…

  • Critical 9.8

    Totolink N300RH Web Management cstecgi.cgi setPasswordCfg os command injection

    A vulnerability has been found in Totolink N300RH 6.1c.1353_B20190305. Affected is the function setPasswordCfg of the file /cgi-bin/cstecgi.cgi of the component Web Management Interface. Such manipulation of the argument admpass leads to os command injection.…

  • Medium 6.3
    CVE-2026-9534 EPSS 10%

    Totolink CA750-PoE Setting cstecgi.cgi setWiFiWpsConfig os command injection

    A flaw has been found in Totolink CA750-PoE 6.2c.510. This affects the function setWiFiWpsConfig of the file /cgi-bin/cstecgi.cgi of the component Setting Handler. Executing a manipulation of the argument PIN can lead to os command injection. It is possible t…

  • Medium 6.3
    CVE-2026-9533 EPSS 10%

    Totolink CA750-PoE Setting cstecgi.cgi recvUpgradeNewFw os command injection

    A vulnerability was detected in Totolink CA750-PoE 6.2c.510. The impacted element is the function recvUpgradeNewFw of the file /cgi-bin/cstecgi.cgi of the component Setting Handler. Performing a manipulation of the argument fwUrl/magicid results in os command…

  • Medium 6.3
    CVE-2026-9532 EPSS 10%

    Totolink CA750-PoE Setting cstecgi.cgi setUploadUserData os command injection

    A security vulnerability has been detected in Totolink CA750-PoE 6.2c.510. The affected element is the function setUploadUserData of the file /cgi-bin/cstecgi.cgi of the component Setting Handler. Such manipulation of the argument FileName leads to os command…

  • Medium 6.3
    CVE-2026-9531 EPSS 10%

    Totolink CA750-PoE Setting cstecgi.cgi setUpgradeUboot os command injection

    A weakness has been identified in Totolink CA750-PoE 6.2c.510. Impacted is the function setUpgradeUboot of the file /cgi-bin/cstecgi.cgi of the component Setting Handler. This manipulation of the argument FileName causes os command injection. The attack is po…

  • High 8.1

    FastNetMon Community Edition through 1.2.9 contains a configuration injection vulnerability in the Juniper router integ…

  • High 8.1

    FastNetMon Community Edition through 1.2.9 contains an OS command injection vulnerability in the MikroTik router integr…

  • High 8.1

    FastNetMon Community Edition through 1.2.9 contains an OS command injection vulnerability in the Juniper router integra…

  • Medium 6.3
    CVE-2026-9515 EPSS 10%

    Totolink CA750-PoE Setting cstecgi.cgi setUnloadUserData os command injection

    A vulnerability was detected in Totolink CA750-PoE 6.2c.510. The affected element is the function setUnloadUserData of the file /cgi-bin/cstecgi.cgi of the component Setting Handler. The manipulation of the argument plugin_version results in os command inject…

  • Medium 6.3
    CVE-2026-9514 EPSS 10%

    Totolink CA750-PoE Setting cstecgi.cgi setNetworkDiag os command injection

    A security vulnerability has been detected in Totolink CA750-PoE 6.2c.510. Impacted is the function setNetworkDiag of the file /cgi-bin/cstecgi.cgi of the component Setting Handler. The manipulation of the argument NetDiagHost/NetDiagPingNum/NetDiagPingSize/N…