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

214 results · Clear filters · Feed

  • High 8.8
    CVE-2022-25175 Public exploit

    Jenkins Pipeline: Multibranch Plugin vulnerable to OS Command Injection

    Jenkins Pipeline: Multibranch Plugin 706.vd43c65dec013 and earlier uses the same checkout directories for distinct SCMs for the readTrusted step, allowing attackers with Item/Configure permission to invoke arbitrary OS commands on the controller through craft…

  • High 8.1
    CVE-2022-0557 Public exploit EPSS 51%

    OS Command Injection in microweber/microweber

    OS Command Injection in Packagist microweber/microweber prior to 1.2.11.

  • High 8.8
    CVE-2021-32849 Public exploit

    Arbitrary command execution in Gerapy

    Gerapy is a distributed crawler management framework. Prior to version 0.9.9, an authenticated user could execute arbitrary commands. This issue is fixed in version 0.9.9. There are no known workarounds.

  • High 8.8
    CVE-2022-20617 Public exploit

    OS command execution vulnerability in Jenkins Docker Commons Plugin

    Jenkins Docker Commons Plugin 1.17 and earlier does not sanitize the name of an image or a tag, resulting in an OS command execution vulnerability exploitable by attackers with Item/Configure permission or able to control the contents of a previously configur…

  • High 8.0
    CVE-2022-21668 Public exploit

    Pipenv's requirements.txt parsing allows malicious index url in comments

    pipenv is a Python development workflow tool. Starting with version 2018.10.9 and prior to version 2022.1.8, a flaw in pipenv's parsing of requirements files allows an attacker to insert a specially crafted string inside a comment anywhere within a requiremen…

  • 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.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 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
    CVE-2020-28243 Public exploit

    SaltStack Salt command injection via a crafted process name

    An issue was discovered in SaltStack Salt before 3002.5. The minion's restartcheck is vulnerable to command injection via a crafted process name. This allows for a local privilege escalation by any user able to create a files on the minion in a non-blackliste…

  • High 7.1
    CVE-2021-21315 Exploited Public exploit Scanner template EPSS 91%

    Command Injection Vulnerability

    The System Information Library for Node.JS (npm package "systeminformation") is an open source collection of functions to retrieve detailed hardware, system and OS information. In systeminformation before version 5.3.1 there is a command injection vulnerabili…

    KEV Jan 18, 2022
  • High 8.8
    CVE-2021-25298 Exploited Public exploit Scanner template EPSS 74%

    Nagios XI version xi-5.7.5 is affected by OS command injection. The vulnerability exists in the file /usr/local/nagiosx…

    KEV Jan 18, 2022
  • High 8.8
    CVE-2021-25297 Exploited Public exploit Scanner template EPSS 57%

    Nagios XI version xi-5.7.5 is affected by OS command injection. The vulnerability exists in the file /usr/local/nagiosx…

    KEV Jan 18, 2022
  • High 7.2
    CVE-2021-3291 Public exploit EPSS 17%

    Zen Cart vulnerable to authenticated remote code execution

    Zen Cart 1.5.7b allows admins to execute arbitrary OS commands by inspecting an HTML radio input element (within the modules edit page) and inserting a command.

  • High 8.0
    CVE-2020-26217 Public exploit Scanner template EPSS 85%

    Remote Code Execution in XStream

    XStream before version 1.4.14 is vulnerable to Remote Code Execution.The vulnerability may allow a remote attacker to run arbitrary shell commands only by manipulating the processed input stream. Only users who rely on blocklists are affected. Anyone using XS…

  • High 7.2
    CVE-2020-14144 Public exploit Scanner template EPSS 95%

    Arbitrary Code Execution in Gitea

    The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer environments where the documentation was not understood (e.g., one viewpoint is that the dangerousness of this feature should be documented imme…

  • High 8.8
    CVE-2020-2261 Public exploit

    OS command execution vulnerability in Perfecto Plugin

    Jenkins Perfecto Plugin 1.17 and earlier executes a command on the Jenkins controller, allowing attackers with Job/Configure permission to run arbitrary commands on the Jenkins controller

  • High 7.2
    CVE-2020-2038 Public exploit EPSS 86%

    PAN-OS: OS command injection vulnerability in the management web interface

    An OS Command Injection vulnerability in the PAN-OS management interface that allows authenticated administrators to execute arbitrary OS commands with root privileges. This issue impacts: PAN-OS 9.0 versions earlier than 9.0.10; PAN-OS 9.1 versions earlier t…

  • High 7.8
    CVE-2020-15778 Public exploit EPSS 14%

    scp in OpenSSH through 8.3p1 allows command injection in the scp.c toremote function, as demonstrated by backtick chara…

  • High 8.8
    CVE-2020-11978 Exploited Public exploit Scanner template EPSS 99%

    Remote code execution (RCE) in Apache Airflow

    An issue was found in Apache Airflow versions 1.10.10 and below. A remote code/command injection vulnerability was discovered in one of the example DAGs shipped with Airflow which would allow any authenticated user to run arbitrary commands as the user runnin…

    KEV Jan 18, 2022
  • High 8.1
    CVE-2020-2034 Public exploit

    PAN-OS: OS command injection vulnerability in GlobalProtect portal

    An OS Command Injection vulnerability in the PAN-OS GlobalProtect portal allows an unauthenticated network based attacker to execute arbitrary OS commands with root privileges. An attacker requires some knowledge of the firewall to exploit this issue. This is…

  • High 8.8
    CVE-2020-1956 Exploited Public exploit Scanner template EPSS 98%

    Command Injection in Kylin

    Apache Kylin 2.3.0, and releases up to 2.6.5 and 3.0.1 has some restful apis which will concatenate os command with the user input string, a user is likely to be able to execute any os command without any protection or validation.

    KEV Mar 25, 2022
  • High 7.3
    CVE-2020-7351 Public exploit EPSS 65%

    Fonality Trixbox CE Post-Authentication Command Injection

    An OS Command Injection vulnerability in the endpoint_devicemap.php component of Fonality Trixbox Community Edition allows an attacker to execute commands on the underlying operating system as the "asterisk" user. Note that Trixbox Community Edition has been …

  • High 8.8
    CVE-2020-10882 Public exploit EPSS 41%

    This vulnerability allows network-adjacent attackers to execute arbitrary code on affected installations of TP-Link Arc…

  • High 7.2
    CVE-2016-11021 Exploited Public exploit EPSS 70%

    setSystemCommand on D-Link DCS-930L devices before 2.12 allows a remote attacker to execute code via an OS command in t…

    KEV Mar 25, 2022
  • High 8.8
    CVE-2020-10221 Exploited Public exploit Scanner template EPSS 77%

    lib/ajaxHandlers/ajaxAddTemplate.php in rConfig through 3.94 allows remote attackers to execute arbitrary OS commands v…

    KEV Nov 3, 2021
  • High 7.8
    CVE-2019-20500 Exploited Public exploit EPSS 97%

    D-Link DWL-2600AP 4.2.0.15 Rev A devices have an authenticated OS command injection vulnerability via the Save Configur…

    KEV Jun 29, 2023
  • High 7.5
    CVE-2019-19356 Exploited Public exploit EPSS 28%

    Netis WF2419 is vulnerable to authenticated Remote Code Execution (RCE) as root through the router Web management page.…

    KEV Nov 3, 2021
  • High 7.2
    CVE-2019-15978 Public exploit EPSS 37%

    Cisco Data Center Network Manager Command Injection Vulnerabilities

    Multiple vulnerabilities in the REST and SOAP API endpoints of Cisco Data Center Network Manager (DCNM) could allow an authenticated, remote attacker with administrative privileges on the DCNM application to inject arbitrary commands on the underlying operati…

  • High 7.2
    CVE-2019-15715 Public exploit EPSS 30%

    MantisBT Remote Code Execution

    MantisBT before 1.3.20 and 2.22.1 allows Post Authentication Command Injection, leading to Remote Code Execution.

  • High 8.8
    CVE-2019-10392 Public exploit EPSS 23%

    Improper Neutralization of Special Elements used in an OS Command in Jenkins Git Client Plugin

    Jenkins Git Client Plugin 2.8.4 and earlier and 3.0.0-rc did not properly restrict values passed as URL argument to an invocation of 'git ls-remote', resulting in OS command injection.

  • High 8.8
    CVE-2019-15949 Exploited Public exploit EPSS 77%

    Nagios XI before 5.6.6 allows remote command execution as root. The exploit requires access to the server as the nagios…

    KEV Nov 3, 2021
  • High 8.8
    CVE-2019-5475 Public exploit EPSS 18%

    OS Command Injection in Nexus Yum Repository Plugin

    The Nexus Yum Repository Plugin in v2 is vulnerable to Remote Code Execution when instances using CommandLineExecutor.java are supplied vulnerable data, such as the Yum Configuration Capability.

  • High 8.8
    CVE-2019-12991 Exploited Public exploit EPSS 74%

    Citrix SD-WAN 10.2.x before 10.2.3 and NetScaler SD-WAN 10.0.x before 10.0.8 have Improper Input Validation (issue 5 of…

    KEV Mar 25, 2022
  • High 7.8
    CVE-2019-13574 Public exploit

    OS Command Injection in MiniMagick

    In lib/mini_magick/image.rb in MiniMagick before 4.9.4, a fetched remote image filename could cause remote command execution because Image.open input is directly passed to Kernel#open, which accepts a '|' character followed by a command.