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

120 results · Clear filters · Feed

  • Critical 9.8
    CVE-2024-6047 Exploited EPSS 10%

    GeoVision EOL device - OS Command Injection

    Certain EOL GeoVision devices fail to properly filter user input for the specific functionality. Unauthenticated remote attackers can exploit this vulnerability to inject and execute arbitrary system commands on the device.

    KEV May 7, 2025
  • Critical 9.8
    CVE-2024-4577 Exploited · Ransomware Public exploit Scanner template EPSS 100%

    Argument Injection in PHP-CGI

    In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command line given to Win32…

    KEV Jun 12, 2024
  • Critical 10.0
    CVE-2024-1212 Exploited Public exploit Scanner template EPSS 95%

    LoadMaster Pre-Authenticated OS Command Injection

    Unauthenticated remote attackers can access the system through the LoadMaster management interface, enabling arbitrary system command execution.

    KEV Nov 18, 2024
  • High 8.0
    CVE-2023-47565 Exploited EPSS 73%

    Legacy VioStor NVR

    An OS command injection vulnerability has been found to affect legacy QNAP VioStor NVR models running QVR Firmware 4.x. If exploited, the vulnerability could allow authenticated users to execute commands via a network. We have already fixed the vulnerability …

    KEV Dec 21, 2023
  • High 8.8
    CVE-2023-49897 Exploited EPSS 50%

    An OS command injection vulnerability exists in AE1021PE firmware version 2.0.9 and earlier and AE1021 firmware version…

    KEV Dec 21, 2023
  • High 7.2
    CVE-2023-44221 Exploited EPSS 76%

    Improper neutralization of special elements in the SMA100 SSL-VPN management interface allows a remote authenticated at…

    KEV May 1, 2025
  • Critical 9.8
    CVE-2023-43208 Exploited · Ransomware Public exploit Scanner template EPSS 86%

    NextGen Healthcare Mirth Connect before version 4.4.1 is vulnerable to unauthenticated remote code execution. Note that…

    KEV May 20, 2024
  • High 7.2
    CVE-2023-20273 Exploited Public exploit EPSS 93%

    A vulnerability in the web UI feature of Cisco IOS XE Software could allow an authenticated, remote attacker to inject …

    KEV Oct 23, 2023
  • High 8.8
    CVE-2023-39780 Exploited Public exploit EPSS 40%

    On ASUS RT-AX55 3.0.0.4.386.51598 devices, authenticated attackers can perform OS command injection via the /start_appl…

    KEV Jun 2, 2025
  • Critical 9.8
    CVE-2023-27992 Exploited EPSS 82%

    The pre-authentication command injection vulnerability in the Zyxel NAS326 firmware versions prior to V5.21(AAZF.14)C0,…

    KEV Jun 23, 2023
  • Critical 9.8
    CVE-2023-28771 Exploited Public exploit EPSS 99%

    Improper error message handling in Zyxel ZyWALL/USG series firmware versions 4.60 through 4.73, VPN series firmware ver…

    KEV May 31, 2023
  • Critical 9.8
    CVE-2023-25280 Exploited Scanner template EPSS 98%

    OS Command injection vulnerability in D-Link DIR820LA1_FW105B03 allows attackers to escalate privileges to root via a c…

    KEV Sep 30, 2024
  • 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
  • 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
  • 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
  • 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-26258 Exploited EPSS 92%

    D-Link DIR-820L 1.05B03 was discovered to contain remote command execution (RCE) vulnerability via HTTP POST to get set…

    KEV Sep 8, 2022
  • Critical 9.8
    CVE-2021-45382 Exploited Scanner template EPSS 98%

    A Remote Command Execution (RCE) vulnerability exists in all series H/W revisions D-link DIR-810L, DIR-820L/LW, DIR-826…

    KEV Apr 4, 2022
  • Critical 9.1
    CVE-2021-40407 Exploited EPSS 48%

    An OS command injection vulnerability exists in the device network settings functionality of reolink RLC-410W v3.0.0.13…

    KEV Dec 18, 2024
  • Critical 9.8
    CVE-2021-27561 Exploited Scanner template EPSS 84%

    Yealink Device Management (DM) 3.6.0.20 allows command injection as root via the /sm/api/v1/firewall/zone/services URI,…

    KEV Nov 3, 2021
  • Medium 6.5
    CVE-2021-20035 Exploited

    Improper neutralization of special elements in the SMA100 management interface allows a remote authenticated attacker t…

    KEV Apr 16, 2025
  • Critical 9.8
    CVE-2021-36260 Exploited Public exploit Scanner template EPSS 100%

    A command injection vulnerability in the web server of some Hikvision product. Due to the insufficient input validation…

    KEV Jan 10, 2022
  • Critical 9.8
    CVE-2021-35394 Exploited Scanner template EPSS 100%

    Realtek Jungle SDK version v2.x up to v3.4.14B provides a diagnostic tool called 'MP Daemon' that is usually compiled a…

    KEV Dec 10, 2021
  • Critical 9.8
    CVE-2021-36380 Exploited Scanner template EPSS 98%

    Sunhillo SureLine before 8.7.0.1.1 allows Unauthenticated OS Command Injection via shell metacharacters in ipAddr or dn…

    KEV Mar 5, 2024
  • Critical 9.8
    CVE-2021-1498 Exploited Public exploit Scanner template EPSS 100%

    Cisco HyperFlex HX Command Injection Vulnerabilities

    Multiple vulnerabilities in the web-based management interface of Cisco HyperFlex HX could allow an unauthenticated, remote attacker to perform command injection attacks against an affected device. For more information about these vulnerabilities, see the Det…

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2021-1497 Exploited Public exploit Scanner template EPSS 100%

    Cisco HyperFlex HX Command Injection Vulnerabilities

    Multiple vulnerabilities in the web-based management interface of Cisco HyperFlex HX could allow an unauthenticated, remote attacker to perform command injection attacks against an affected device. For more information about these vulnerabilities, see the Det…

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2020-2509 Exploited Public exploit EPSS 34%

    Command Injection Vulnerability in QTS and QuTS hero

    A command injection vulnerability has been reported to affect QTS and QuTS hero. If exploited, this vulnerability allows attackers to execute arbitrary commands in a compromised application. We have already fixed this vulnerability in the following versions: …

    KEV Apr 11, 2022
  • Critical 9.8
    CVE-2021-27104 Exploited · Ransomware EPSS 46%

    Accellion FTA 9_12_370 and earlier is affected by OS command execution via a crafted POST request to various admin endp…

    KEV Nov 3, 2021
  • High 7.8
    CVE-2021-27102 Exploited · Ransomware

    Accellion FTA 9_12_411 and earlier is affected by OS command execution via a local web service call. The fixed version …

    KEV Nov 3, 2021
  • 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
  • Critical 9.8
    CVE-2021-22502 Exploited Public exploit Scanner template EPSS 97%

    Remote Code execution vulnerability in Micro Focus Operation Bridge Reporter (OBR) product, affecting version 10.40. Th…

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2020-25506 Exploited Scanner template EPSS 100%

    D-Link DNS-320 FW v2.06B01 Revision Ax is affected by command injection in the system_mgr.cgi component, which can lead…

    KEV Nov 3, 2021
  • Critical 9.1
    CVE-2020-4006 Exploited EPSS 17%

    VMware Workspace One Access, Access Connector, Identity Manager, and Identity Manager Connector address have a command …

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2020-16846 Exploited Public exploit Scanner template EPSS 100%

    SaltStack Salt Command Injection in netapi ssh client

    An issue was discovered in SaltStack Salt through 3002. Sending crafted web requests to the Salt API, with the SSH client enabled, can result in shell injection.

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2018-19949 Exploited · Ransomware EPSS 30%

    If exploited, this command injection vulnerability could allow remote attackers to run arbitrary commands. QNAP has alr…

    KEV May 24, 2022
  • Critical 9.8
    CVE-2020-25223 Exploited Public exploit Scanner template EPSS 97%

    A remote code execution vulnerability exists in the WebAdmin of Sophos SG UTM before v9.705 MR5, v9.607 MR7, and v9.511…

    KEV Mar 25, 2022
  • 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