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

508 results · Clear filters · Feed

  • High 7.1
    CVE-2023-26039 Public exploit

    ZoneMinder vulnerable to OS Command injection in daemonControl() API

    ZoneMinder is a free, open source Closed-circuit television software application for Linux which supports IP, USB and Analog cameras. Versions prior to 1.36.33 and 1.37.33 contain an OS Command Injection via daemonControl() in (/web/api/app/Controller/HostCon…

  • Critical 9.8
    CVE-2022-36231 Public exploit

    Code injection in pdf_info

    pdf_info 0.5.3 is vulnerable to Command Execution because the Ruby code uses backticks instead of Open3.

  • Medium 6.3
    CVE-2023-0830 Public exploit EPSS 21%

    EasyNAS backup.pl system os command injection

    A vulnerability classified as critical has been found in EasyNAS 1.1.0. Affected is the function system of the file /backup.pl. The manipulation leads to os command injection. It is possible to launch the attack remotely. The exploit has been disclosed to the…

  • High 8.8
    CVE-2022-46649 Public exploit

    Acemanager in ALEOS before version 4.16 allows a user with valid credentials to manipulate the IP logging operation to …

  • High 8.8
    CVE-2022-46552 Public exploit EPSS 11%

    D-Link DIR-846 Firmware FW100A53DBR was discovered to contain a remote command execution (RCE) vulnerability via the la…

  • High 8.8
    CVE-2023-24422 Public exploit

    Sandbox bypass in Jenkins Script Security Plugin

    A sandbox bypass vulnerability involving map constructors in Jenkins Script Security Plugin 1228.vd93135a_2fb_25 and earlier allows attackers with permission to define and run sandboxed scripts, including Pipelines, to bypass the sandbox protection and execut…

  • High 7.8
    CVE-2022-45639 Public exploit

    OS Command injection vulnerability in sleuthkit fls tool 4.11.1 allows attackers to execute arbitrary commands via a cr…

  • High 7.2
    CVE-2022-43973 Public exploit

    Arbitrary code execution in Linksys WRT54GL

    An arbitrary code execution vulnerability exisits in Linksys WRT54GL Wireless-G Broadband Router with firmware <= 4.30.18.006. The Check_TSSI function within the httpd binary uses unvalidated user input in the construction of a system command. An authenticate…

  • High 8.8
    CVE-2022-44149 Public exploit EPSS 64%

    The web service on Nexxt Amp300 ARN02304U8 42.103.1.5095 and 80.103.2.5045 devices allows remote OS command execution b…

  • Critical 9.8
    CVE-2022-44877 Exploited Public exploit Scanner template EPSS 100%

    login/index.php in CWP (aka Control Web Panel or CentOS Web Panel) 7 before 0.9.8.1147 allows remote attackers to execu…

    KEV Jan 17, 2023
  • Medium 4.6
    CVE-2021-4281 Public exploit

    Brave UX for-the-badge combine-prs.yml os command injection

    A vulnerability was found in Brave UX for-the-badge and classified as critical. Affected by this issue is some unknown functionality of the file .github/workflows/combine-prs.yml. The manipulation leads to os command injection. The name of the patch is 55b5a2…

  • Critical 9.8
    CVE-2022-40624 Public exploit Scanner template EPSS 18%

    pfSense pfBlockerNG through 2.1.4_27 allows remote attackers to execute arbitrary OS commands as root via the HTTP Host…

  • Critical 9.8
    CVE-2022-45025 Public exploit EPSS 35%

    Markdown Preview Enhanced v0.6.5 and v0.19.6 for VSCode and Atom was discovered to contain a command injection vulnerab…

  • Critical 9.8
    CVE-2020-6627 Public exploit EPSS 13%

    The web-management application on Seagate Central NAS STCG2000300, STCG3000300, and STCG4000300 devices allows OS comma…

  • High 8.8
    CVE-2022-40127 Public exploit Scanner template EPSS 86%

    Apache Airflow <2.4.0 has an RCE in a bash example

    A vulnerability in Example Dags of Apache Airflow allows an attacker with UI access who can trigger DAGs, to execute arbitrary commands via manually provided run_id parameter. This issue affects Apache Airflow Apache Airflow versions prior to 2.4.0.

  • Medium 6.8
    CVE-2022-31898 Public exploit EPSS 16%

    gl-inet GL-MT300N-V2 Mango v3.212 and GL-AX1800 Flint v3.214 were discovered to contain multiple command injection vuln…

  • Critical 9.8
    CVE-2016-20016 Public exploit EPSS 86%

    MVPower CCTV DVR models, including TV-7104HE 1.8.4 115215B9 and TV7108HE, contain a web shell that is accessible via a …

  • Critical 9.9
    CVE-2022-2884 Public exploit EPSS 76%

    A vulnerability in GitLab CE/EE affecting all versions from 11.3.4 prior to 15.1.5, 15.2 to 15.2.3, 15.3 to 15.3 to 15.…

  • Medium 6.4
    CVE-2022-40635 Public exploit

    Improper Control of Dynamically-Managed Code Resources in Crafter Studio

    Improper Control of Dynamically-Managed Code Resources vulnerability in Crafter Studio of Crafter CMS allows authenticated developers to execute OS commands via Groovy Sandbox Bypass.

  • Medium 6.4
    CVE-2022-40634 Public exploit

    Improper Control of Dynamically-Managed Code Resources in Crafter Studio

    Improper Control of Dynamically-Managed Code Resources vulnerability in Crafter Studio of Crafter CMS allows authenticated developers to execute OS commands via FreeMarker SSTI.

  • Critical 9.8
    CVE-2022-31814 Public exploit Scanner template EPSS 92%

    pfSense pfBlockerNG through 2.1.4_26 allows remote attackers to execute arbitrary OS commands as root via shell metacha…

  • High 8.8
    CVE-2022-36804 Exploited Public exploit Scanner template EPSS 99%

    Multiple API endpoints in Atlassian Bitbucket Server and Data Center 7.0.0 before version 7.6.17, from version 7.7.0 be…

    KEV Sep 30, 2022
  • Medium 6.0
    CVE-2022-22555 Public exploit

    Dell EMC PowerStore, contains an OS command injection Vulnerability. A locally authenticated attacker could potentially…

  • High 8.8
    CVE-2022-33891 Exploited Public exploit Scanner template EPSS 93%

    Apache Spark shell command injection vulnerability via Spark UI

    The Apache Spark UI offers the possibility to enable ACLs via the configuration option spark.acls.enable. With an authentication filter, this checks whether a user has access permissions to view or modify the application. If ACLs are enabled, a code path in H…

    KEV Mar 7, 2023
  • High 8.8
    CVE-2022-31138 Public exploit

    OS Command Injection in mailcow

    mailcow is a mailserver suite. Prior to mailcow-dockerized version 2022-06a, an extended privilege vulnerability can be exploited by manipulating the custom parameters regexmess, skipmess, regexflag, delete2foldersonly, delete2foldersbutnot, regextrans2, pipe…

  • Critical 10.0
    CVE-2022-31137 Public exploit Scanner template EPSS 91%

    Unauthenticated Remote Code Execution in Roxy-WI

    Roxy-WI is a web interface for managing Haproxy, Nginx, Apache and Keepalived servers. Versions prior to 6.1.1.0 are subject to a remote code execution vulnerability. System commands can be run remotely via the subprocess_execute function without processing t…

  • High 7.5
    CVE-2022-28171 Public exploit EPSS 52%

    The web module in some Hikvision Hybrid SAN/Cluster Storage products have the following security vulnerability. Due to …

  • High 8.8
    CVE-2022-33140 Public exploit

    Improper Neutralization of Command Elements in Shell User Group Provider

    The optional ShellUserGroupProvider in Apache NiFi 1.10.0 to 1.16.2 and Apache NiFi Registry 0.6.0 to 1.16.2 does not neutralize arguments for group resolution commands, allowing injection of operating system commands on Linux and macOS platforms. The ShellUs…

  • Medium 6.3
    CVE-2019-25065 Public exploit

    OpenNetAdmin os command injection

    A vulnerability was found in OpenNetAdmin 18.1.1. It has been rated as critical. Affected by this issue is some unknown functionality. The manipulation leads to privilege escalation. The attack may be launched remotely. The exploit has been disclosed to the p…

  • Critical 9.8
    CVE-2022-29303 Exploited Public exploit Scanner template EPSS 98%

    SolarView Compact ver.6.00 was discovered to contain a command injection vulnerability via conf_mail.php.

    KEV Jul 13, 2023
  • Critical 9.8
    CVE-2022-30525 Exploited Public exploit Scanner template EPSS 100%

    A OS command injection vulnerability in the CGI program of Zyxel USG FLEX 100(W) firmware versions 5.00 through 5.21 Pa…

    KEV May 16, 2022
  • Critical 9.8
    CVE-2022-1292 Public exploit EPSS 83%

    The c_rehash script allows command injection

    The c_rehash script does not properly sanitise shell metacharacters to prevent command injection. This script is distributed by some operating systems in a manner where it is automatically executed. On such operating systems, an attacker could execute arbitra…

  • Critical 9.8
    CVE-2021-46704 Public exploit Scanner template EPSS 22%

    OS Command Injection in GenieACS

    In GenieACS 1.2.x before 1.2.8, the UI interface API is vulnerable to unauthenticated OS command injection via the ping host argument (lib/ui/api.ts and lib/ping.ts). The vulnerability arises from insufficient input validation combined with a missing authoriz…

  • Critical 10.0
    CVE-2022-0848 Public exploit EPSS 35%

    OS Command Injection in part-db/part-db

    OS Command Injection in GitHub repository part-db/part-db prior to 0.5.11.

  • Critical 9.8
    CVE-2021-4039 Public exploit EPSS 71%

    A command injection vulnerability in the web interface of the Zyxel NWA-1100-NH firmware could allow an attacker to exe…

  • High 8.8
    CVE-2022-25174 Public exploit

    Improper Neutralization of Special Elements used in an OS Command in Jenkins Pipeline: Shared Groovy Libraries Plugin

    Jenkins Pipeline: Shared Groovy Libraries Plugin 552.vd9cc05b8a2e1 and earlier uses the same checkout directories for distinct SCMs for Pipeline libraries, allowing attackers with Item/Configure permission to invoke arbitrary OS commands on the controller thr…

  • High 8.8
    CVE-2022-25173 Public exploit

    Improper Neutralization of Special Elements used in an OS Command in Jenkins Pipeline: Groovy Plugin

    Jenkins Pipeline: Groovy Plugin 2648.va9433432b33c and earlier uses the same checkout directories for distinct SCMs when reading the script file (typically Jenkinsfile) for Pipelines, allowing attackers with Item/Configure permission to invoke arbitrary OS co…

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