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

2,705 results · Clear filters · Feed

  • High 8.8
    CVE-2021-20039 Public exploit EPSS 79%

    Improper neutralization of special elements in the SMA100 management interface '/cgi-bin/viewcert' POST http method all…

  • High 8.8

    ipTIME C200 IP Camera command injection vulnerability

    This issue was discovered when the ipTIME C200 IP Camera was synchronized with the ipTIME NAS. It is necessary to extract value for ipTIME IP camera because the ipTIME NAS send ans setCookie('[COOKIE]') . The value is transferred to the --header option in wge…

  • High 7.5

    OS Command Injection in ohmyzsh/ohmyzsh

    # Vulnerability in `pygmalion`, `pygmalion-virtualenv` and `refined` themes **Description**: these themes use `print -P` on user-supplied strings to print them to the terminal. All of them do that on git information, particularly the branch name, so if the br…

  • High 7.5

    OS Command Injection in ohmyzsh/ohmyzsh

    # Vulnerability in `rand-quote` and `hitokoto` plugins **Description**: the `rand-quote` and `hitokoto` fetch quotes from quotationspage.com and hitokoto.cn respectively, do some process on them and then use `print -P` to print them. If these quotes contained…

  • High 7.5

    OS Command Injection in ohmyzsh/ohmyzsh

    # Vulnerability in `title` function **Description**: the `title` function defined in `lib/termsupport.zsh` uses `print` to set the terminal title to a user-supplied string. In Oh My Zsh, this function is always used securely, but custom user code could use th…

  • High 7.5

    OS Command Injection in ohmyzsh/ohmyzsh

    Vulnerability in dirhistory plugin Description: the widgets that go back and forward in the directory history, triggered by pressing Alt-Left and Alt-Right, use functions that unsafely execute eval on directory names. If you cd into a directory with a careful…

  • High 7.2

    A command injection vulnerability was reported in the Integrated Management Module (IMM) of legacy IBM System x 3550 M3…

  • High 8.8
    CVE-2021-3577 Scanner template EPSS 60%

    An unauthenticated remote code execution vulnerability was reported in some Motorola-branded Binatone Hubble Cameras th…

  • High 8.8

    Privilege escalation to cluster admin on multi-tenant environments

    kustomize-controller is a Kubernetes operator, specialized in running continuous delivery pipelines for infrastructure and workloads defined with Kubernetes manifests and assembled with Kustomize. Users that can create Kubernetes Secrets, Service Accounts and…

  • High 7.8

    OS Command Injection in ohmyzsh/ohmyzsh

    ohmyzsh is vulnerable to Improper Neutralization of Special Elements used in an OS Command

  • High 8.1
    CVE-2021-3060 Public exploit EPSS 33%

    PAN-OS: OS Command Injection in Simple Certificate Enrollment Protocol (SCEP)

    An OS command injection vulnerability in the Simple Certificate Enrollment Protocol (SCEP) feature of PAN-OS software allows an unauthenticated network-based attacker with specific knowledge of the firewall configuration to execute arbitrary code with root us…

  • High 8.1

    PAN-OS: OS Command Injection Vulnerability When Performing Dynamic Updates

    An OS command injection vulnerability in the Palo Alto Networks PAN-OS management interface exists when performing dynamic updates. This vulnerability enables a man-in-the-middle attacker to execute arbitrary OS commands to escalate privileges. This issue imp…

  • High 8.8

    PAN-OS: OS Command Injection Vulnerability in Web Interface XML API

    An OS command injection vulnerability in the Palo Alto Networks PAN-OS web interface enables an authenticated administrator with permissions to use XML API the ability to execute arbitrary OS commands to escalate privileges. This issue impacts: PAN-OS 8.1 ver…

  • High 7.5

    Code injection in `saved_model_cli`

    TensorFlow is an open source platform for machine learning. In affected versions TensorFlow's `saved_model_cli` tool is vulnerable to a code injection as it calls `eval` on user supplied strings. This can be used by attackers to run arbitrary code on the plaf…

  • High 8.0

    Emerson WirelessHART Gateway

    The affected product is vulnerable to a parameter injection via passphrase, which enables the attacker to supply uncontrolled input.

  • High 8.7

    Command Injection Vulnerability in Media Streaming Add-on

    A command injection vulnerability has been reported to affect QNAP device running Media Streaming add-on. If exploited, this vulnerability allow remote attackers to run arbitrary commands. We have already fixed this vulnerability in the following versions of …

  • High 7.8

    Cisco IOS XE SD-WAN Software Command Injection Vulnerability

    A vulnerability in the CLI of Cisco IOS XE SD-WAN Software could allow an authenticated, local attacker to execute arbitrary commands with root privileges. The vulnerability is due to insufficient input validation by the system CLI. An attacker could exploit …

  • High 7.2

    Command Injection Vulnerability in QVR

    A command injection vulnerability has been reported to affect QNAP device running QVR. If exploited, this vulnerability could allow remote attackers to run arbitrary commands. We have already fixed this vulnerability in the following versions of QVR: QVR 5.1.…

  • High 7.3

    A command injection vulnerability in the CGI program of the Zyxel VPN2S firmware version 1.12 could allow an authentica…

  • High 8.6

    Adobe Digital Editions Command Execution Vulnerability

    Adobe Digital Editions 4.5.11.187646 (and earlier) are affected by an arbitrary command execution vulnerability. An authenticated attacker could leverage this vulnerability to execute arbitrary commands. User interaction is required to abuse this vulnerabilit…

  • High 7.2

    Command Injection Vulnerability in QVR

    A command injection vulnerability has been reported to affect QNAP device running QVR. If exploited, this vulnerability could allow remote attackers to run arbitrary commands. We have already fixed this vulnerability in the following versions of QVR: QVR 5.1.…

  • High 7.5

    Command injection in mscdex/ssh2

    ssh2 is client and server modules written in pure JavaScript for node.js. In ssh2 before version 1.4.0 there is a command injection vulnerability. The issue only exists on Windows. This issue may lead to remote code execution if a client of the library calls …

  • High 7.2
    CVE-2021-33554 Public exploit EPSS 59%

    UDP Technology/Geutebrück camera devices: Command injection in appfile.filename parameter leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.2
    CVE-2021-33553 Public exploit EPSS 51%

    UDP Technology/Geutebrück camera devices: Command injection in command parameter leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.2
    CVE-2021-33552 Public exploit EPSS 51%

    UDP Technology/Geutebrück camera devices: Command injection in date parameter leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.2
    CVE-2021-33551 Public exploit EPSS 51%

    UDP Technology/Geutebrück camera devices: Command injection in environment.lang parameter leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.2
    CVE-2021-33550 Public exploit EPSS 59%

    UDP Technology/Geutebrück camera devices: Command injection in date parameter leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.2
    CVE-2021-33548 Public exploit EPSS 59%

    UDP Technology/Geutebrück camera devices: Command injection in preserve parameter leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.2
    CVE-2021-33544 Public exploit Scanner template EPSS 96%

    UDP Technology/Geutebrück camera devices: command injection leading to RCE

    Multiple camera devices by UDP Technology, Geutebrück and other vendors are vulnerable to command injection, which may allow an attacker to remotely execute arbitrary code.

  • High 7.8

    Cisco IOS XR Software Authenticated User Privilege Escalation Vulnerabilities

    Multiple vulnerabilities in the CLI of Cisco IOS XR Software could allow an authenticated, local attacker with a low-privileged account to elevate privileges on an affected device. For more information about these vulnerabilities, see the Details section of t…

  • High 7.8

    Cisco IOS XR Software Authenticated User Privilege Escalation Vulnerabilities

    Multiple vulnerabilities in the CLI of Cisco IOS XR Software could allow an authenticated, local attacker with a low-privileged account to elevate privileges on an affected device. For more information about these vulnerabilities, see the Details section of t…

  • High 8.3

    Adobe After Effects improper neutralization of special elements could lead to remote code execution

    Adobe After Effects version 18.1 (and earlier) is affected by a potential Command injection vulnerability when chained with a development and debugging tool for JavaScript scripts. An unauthenticated attacker could leverage this vulnerability to achieve arbit…

  • High 8.3

    Adobe Illustrator improper neutralization of special elements used in an OS command

    Adobe Illustrator version 25.2.3 (and earlier) is affected by a potential Command injection vulnerability when chained with a development and debugging tool for JavaScript scripts. An unauthenticated attacker could leverage this vulnerability to achieve arbit…

  • High 8.2

    Adobe Acrobat Reader AcrobatUtils.scpt Extension OS Command Injection Vulnerability

    Acrobat Reader DC versions 2021.005.20054 (and earlier), 2020.004.30005 (and earlier) and 2017.011.30197 (and earlier) are affected by an Improper Neutralization of Special Elements used in an OS Command. An authenticated attacker could leverage this vulnerab…

  • High 8.8

    OS Command Injection in Centreon

    /graphStatus/displayServiceStatus.php in Centreon 19.10.8 allows remote attackers to execute arbitrary OS commands via shell metacharacters in the RRDdatabase_path parameter.

  • High 7.2

    A vulnerability was reported in Lenovo Smart Camera X3, X5, and C2E that could allow command injection by setting a spe…

  • High 8.8

    Command injection in mail agent settings

    Shopware is an open source eCommerce platform. Versions prior to 6.4.3.1 contain a command injection vulnerability in mail agent settings. Version 6.4.3.1 contains a patch. As workarounds for older versions of 6.1, 6.2, and 6.3, corresponding security measure…

  • High 7.8

    Arbitrary Code Injection

    This affects the package bikeshed before 3.0.0. This can occur when an untrusted source file containing Inline Tag Command metadata is processed. When an arbitrary OS command is executed, the command output would be included in the HTML output.

  • High 8.8

    PAN-OS: OS Command Injection Vulnerability in Web Interface

    An OS command injection vulnerability in the Palo Alto Networks PAN-OS web interface enables an authenticated administrator to execute arbitrary OS commands to escalate privileges. This issue impacts: PAN-OS 9.0 version 9.0.10 through PAN-OS 9.0.14; PAN-OS 9.…

  • High 7.8

    Command injection in Yamale

    23andMe Yamale before 3.0.8 allows remote attackers to execute arbitrary code via a crafted schema file. The schema parser uses eval as part of its processing, and tries to protect from malicious expressions by limiting the builtins that are passed to the eva…