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-2020-10987 Exploited Public exploit Scanner template EPSS 80%

    The goform/setUsbUnload endpoint of Tenda AC15 AC1900 version 15.03.05.19 allows remote attackers to execute arbitrary …

    KEV Nov 3, 2021
  • High 8.8
    CVE-2020-9377 Exploited EPSS 22%

    D-Link DIR-610 devices allow Remote Command Execution via the cmd parameter to command.php. NOTE: This vulnerability on…

    KEV Mar 25, 2022
  • Critical 9.8
    CVE-2020-15415 Exploited Scanner template EPSS 84%

    On DrayTek Vigor3900, Vigor2960, and Vigor300B devices before 1.5.1, cgi-bin/mainfunction.cgi/cvmcfgupload allows remot…

    KEV Sep 30, 2024
  • Critical 9.1
    CVE-2020-8816 Exploited Public exploit EPSS 78%

    Pi-hole Web v4.3.2 (aka AdminLTE) allows Remote Code Execution by privileged dashboard users via a crafted DHCP static …

    KEV Dec 10, 2021
  • 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
  • Critical 9.1
    CVE-2020-4428 Exploited Public exploit EPSS 62%

    IBM Data Risk Manager 2.0.1, 2.0.2, 2.0.3, and 2.0.4 could allow a remote authenticated attacker to execute arbitrary c…

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

    rcube_image.php in Roundcube Webmail before 1.4.4 allows attackers to execute arbitrary code via shell metacharacters i…

    KEV Jun 22, 2023
  • 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
  • Critical 9.8
    CVE-2020-9054 Exploited Public exploit Scanner template EPSS 100%

    ZyXEL NAS products running firmware version 5.21 and earlier are vulnerable to pre-authentication command injection in weblogin.cgi

    Multiple ZyXEL network-attached storage (NAS) devices running firmware version 5.21 contain a pre-authentication command injection vulnerability, which may allow a remote, unauthenticated attacker to execute arbitrary code on a vulnerable device. ZyXEL NAS de…

    KEV Mar 25, 2022
  • 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
  • Critical 9.8
    CVE-2020-8515 Exploited Public exploit Scanner template EPSS 100%

    DrayTek Vigor2960 1.3.1_Beta, Vigor3900 1.4.4_Beta, and Vigor300B 1.3.3_Beta, 1.4.2.1_Beta, and 1.4.4_Beta devices allo…

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2019-17621 Exploited Public exploit EPSS 91%

    The UPnP endpoint URL /gena.cgi in the D-Link DIR-859 Wi-Fi router 1.05 and 1.06B01 Beta01 allows an Unauthenticated re…

    KEV Jun 29, 2023
  • Critical 9.9
    CVE-2019-10758 Exploited Public exploit Scanner template EPSS 85%

    Remote Code Execution Vulnerability in NPM mongo-express

    mongo-express before 0.54.0 is vulnerable to Remote Code Execution via endpoints that uses the `toBSON` method. A misuse of the `vm` dependency to perform `exec` commands in a non-safe environment.

    KEV Dec 10, 2021
  • Critical 9.8
    CVE-2019-16920 Exploited Public exploit Scanner template EPSS 100%

    Unauthenticated remote code execution occurs in D-Link products such as DIR-655C, DIR-866L, DIR-652, and DHP-1565. The …

    KEV Mar 25, 2022
  • Critical 9.8
    CVE-2019-16057 Exploited · Ransomware Scanner template EPSS 86%

    The login_mgr.cgi script in D-Link DNS-320 through 2.05.B10 is vulnerable to remote command injection.

    KEV Apr 15, 2022
  • 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
  • Critical 9.8
    CVE-2019-15107 Exploited · Ransomware Public exploit Scanner template EPSS 100%

    An issue was discovered in Webmin <=1.920. The parameter old in password_change.cgi contains a command injection vulner…

    KEV Mar 25, 2022
  • 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
  • Critical 9.8
    CVE-2019-7256 Exploited Public exploit Scanner template EPSS 97%

    Linear eMerge E3-Series devices allow Command Injections.

    KEV Mar 25, 2024
  • Critical 9.0
    CVE-2019-10149 Exploited Public exploit EPSS 100%

    A flaw was found in Exim versions 4.87 to 4.91 (inclusive). Improper validation of recipient address in deliver_message…

    KEV Jan 10, 2022
  • Critical 9.8
    CVE-2018-14839 Exploited EPSS 89%

    LG N1A1 NAS 3718.510 is affected by: Remote Command Execution. The impact is: execute arbitrary code (remote). The atta…

    KEV Mar 25, 2022
  • Critical 9.8
    CVE-2017-18368 Exploited Public exploit EPSS 95%

    The ZyXEL P660HN-T1A v1 TCLinux Fw $7.3.15.0 v001 / 3.40(ULM.0)b31 router distributed by TrueOnline has a command injec…

    KEV Aug 7, 2023
  • High 8.0
    CVE-2019-11539 Exploited · Ransomware Public exploit EPSS 99%

    In Pulse Secure Pulse Connect Secure version 9.0RX before 9.0R3.4, 8.3RX before 8.3R7.1, 8.2RX before 8.2R12.1, and 8.1…

    KEV Nov 3, 2021
  • High 7.2
    CVE-2019-11001 Exploited EPSS 38%

    On Reolink RLC-410W, C1 Pro, C2 Pro, RLC-422W, and RLC-511W devices through 1.0.227, an authenticated admin can use the…

    KEV Dec 18, 2024
  • Critical 9.8
    CVE-2018-14558 Exploited

    An issue was discovered on Tenda AC7 devices with firmware through V15.03.06.44_CN(AC7), AC9 devices with firmware thro…

    KEV Nov 3, 2021
  • Critical 9.8
    CVE-2018-14933 Exploited Public exploit Scanner template EPSS 95%

    upgrade_handle.php on NUUO NVRmini devices allows Remote Command Execution via shell metacharacters in the uploaddir pa…

    KEV Dec 18, 2024
  • High 7.2
    CVE-2018-9276 Exploited Public exploit EPSS 87%

    An issue was discovered in PRTG Network Monitor before 18.2.39. An attacker who has access to the PRTG System Administr…

    KEV Feb 4, 2025
  • High 8.1
    CVE-2018-6961 Exploited Public exploit Scanner template EPSS 85%

    VMware NSX SD-WAN Edge by VeloCloud prior to version 3.1.0 contains a command injection vulnerability in the local web …

    KEV Mar 25, 2022
  • Critical 9.8
    CVE-2018-11138 Exploited · Ransomware Public exploit Scanner template EPSS 92%

    The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible b…

    KEV Mar 25, 2022
  • Critical 9.8
    CVE-2018-10562 Exploited · Ransomware Public exploit Scanner template EPSS 100%

    An issue was discovered on Dasan GPON home routers. Command Injection can occur via the dest_host parameter in a diag_a…

    KEV Mar 31, 2022
  • Critical 9.8
    CVE-2018-6530 Exploited · Ransomware Scanner template EPSS 97%

    OS command injection vulnerability in soap.cgi (soapcgi_main in cgibin) in D-Link DIR-880L DIR-880L_REVA_FIRMWARE_PATCH…

    KEV Sep 8, 2022
  • High 7.4
    CVE-2017-3506 Exploited Public exploit Scanner template EPSS 96%

    Vulnerability in the Oracle WebLogic Server component of Oracle Fusion Middleware (subcomponent: Web Services). Support…

    KEV Jun 3, 2024
  • High 8.8
    CVE-2017-6884 Exploited · Ransomware Public exploit EPSS 33%

    A command injection vulnerability was discovered on the Zyxel EMG2926 home router with firmware V1.00(AAQT.4)b8. The vu…

    KEV Sep 18, 2023
  • High 8.8
    CVE-2017-6334 Exploited Public exploit EPSS 73%

    dnslookup.cgi on NETGEAR DGN2200 devices with firmware through 10.0.0.50 allows remote authenticated users to execute a…

    KEV Mar 25, 2022
  • Critical 9.8
    CVE-2017-6077 Exploited Public exploit EPSS 69%

    ping.cgi on NETGEAR DGN2200 devices with firmware through 10.0.0.50 allows remote authenticated users to execute arbitr…

    KEV Mar 7, 2022
  • High 8.8
    CVE-2014-6278 Exploited Public exploit EPSS 100%

    GNU Bash through 4.3 bash43-026 does not properly parse function definitions in the values of environment variables, wh…

    KEV Oct 2, 2025
  • Critical 9.8
    CVE-2014-7169 Exploited Public exploit EPSS 100%

    GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values o…

    KEV Jan 28, 2022
  • Critical 9.8
    CVE-2014-6271 Exploited Public exploit Scanner template EPSS 100%

    GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, whic…

    KEV Jan 28, 2022