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

1,588 results · Clear filters · Feed

  • Critical 9.8

    In TOTOLINK X6000R V9.4.0cu.852_B20230719, the shttpd file, sub_4119A0 function obtains fields from the front-end throu…

  • Critical 9.8
    CVE-2023-3368 Scanner template EPSS 70%

    Chamilo LMS Unauthenticated Command Injection

    Command injection in `/main/webservices/additional_webservices.php` in Chamilo LMS <= v1.11.20 allows unauthenticated attackers to obtain remote code execution via improper neutralisation of special characters. This is a bypass of CVE-2023-34960.

  • Critical 9.8

    WAGO: OS Command Injection Vulnerability in Managed Switch

    A vulnerability in the web-based management allows an unauthenticated remote attacker to inject arbitrary system commands and gain full system control. Those commands are executed with root privileges. The vulnerability is located in the user request handling…

  • Critical 9.9

    OS Command Injection in INEA ME RTU

    Versions of INEA ME RTU firmware 3.36b and prior are vulnerable to operating system (OS) command injection, which could allow remote code execution.

  • Critical 9.8
    CVE-2023-6019 Public exploit EPSS 75%

    Ray Command Injection in cpu_profile Parameter

    A command injection existed in Ray's cpu_profile URL parameter allowing attackers to execute os commands on the system running the ray dashboard remotely without authentication. The issue is fixed in version 2.8.1+. Ray maintainers' response can be found here…

  • Critical 10.0
    CVE-2023-6018 Scanner template EPSS 48%

    MLflow Arbitrary File Write

    An attacker can overwrite any file on the server hosting MLflow without any authentication.

  • Critical 9.3

    A improper neutralization of special elements used in an os command ('os command injection') in Fortinet FortiSIEM vers…

  • Critical 9.0
    CVE-2023-23369 EPSS 14%

    QTS, Multimedia Console, and Media Streaming add-on

    An OS command injection vulnerability has been reported to affect several QNAP operating system versions. If exploited, the vulnerability could allow users to execute commands via a network. We have already fixed the vulnerability in the following versions: M…

  • Critical 9.8
    CVE-2023-23368 EPSS 18%

    QTS, QuTS hero, QuTScloud

    An OS command injection vulnerability has been reported to affect several QNAP operating system versions. If exploited, the vulnerability could allow users to execute commands via a network. We have already fixed the vulnerability in the following versions: Q…

  • 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
  • Critical 9.8

    Hardcoded manufacturer credentials and an OS command injection vulnerability in the /cgi-bin/mft/ directory on ABUS TVI…

  • Critical 9.6

    Inadequate validation of retrieved subdomains may lead to a Remote Code Execution in reconFTW

    reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities. A vulnerability has been identified in reconftw where inadequate validation of retrieved subdomains…

  • Critical 10.0

    OS command injection vulnerability in FreshTomato 2023.3

    An OS command injection vulnerability exists in the httpd iperfrun.cgi functionality of FreshTomato 2023.3. A specially crafted HTTP request can lead to arbitrary command execution. An attacker can send an HTTP request to trigger this vulnerability.

  • Critical 9.1

    Remote code execution vulnerability during the installation of ACAP applications on the Axis device

    GoSecure on behalf of Genetec Inc. has found a flaw that allows for a remote code execution during the installation of ACAP applications on the Axis device. The application handling service in AXIS OS was vulnerable to command injection allowing an attacker t…

  • Critical 9.6

    A improper neutralization of special elements used in an os command ('os command injection') in Fortinet FortiWLM versi…

  • Critical 9.6

    A improper neutralization of special elements used in an os command ('os command injection') in Fortinet FortiWLM versi…

  • Critical 9.6
    CVE-2023-34993 Scanner template EPSS 21%

    A improper neutralization of special elements used in an os command ('os command injection') in Fortinet FortiWLM versi…

  • Critical 9.6

    A improper neutralization of special elements used in an os command ('os command injection') in Fortinet FortiWLM versi…

  • Critical 9.7
    CVE-2023-34992 Public exploit Scanner template EPSS 82%

    A improper neutralization of special elements used in an os command ('os command injection') vulnerability in Fortinet …

  • Critical 9.8
    CVE-2023-30806 EPSS 65%

    Sangfor Next-Gen Application Firewall PHPSESSID Command Injection

    The Sangfor Next-Gen Application Firewall version NGAF8.0.17 is vulnerable to an operating system command injection vulnerability. A remote and unauthenticated attacker can execute arbitrary commands by sending a crafted HTTP POST request to the /cgi-bin/logi…

  • Critical 9.8
    CVE-2023-30805 EPSS 65%

    Sangfor Next-Gen Application Firewall Login Un Param Command Injection

    The Sangfor Next-Gen Application Firewall version NGAF8.0.17 is vulnerable to an operating system command injection vulnerability. A remote and unauthenticated attacker can execute arbitrary commands by sending a crafted HTTP POST request to the /LogInOut.php…

  • Critical 9.8

    Netis N3Mv2-V1.0.1.865 was discovered to contain a command injection vulnerability via the Hostname parameter within th…

  • Critical 9.8

    OS command injection on EasyPHP Webserver

    An OS command injection vulnerability has been found on EasyPHP Webserver affecting version 14.1. This vulnerability could allow an attacker to get full access to the system by sending a specially crafted exploit to the /index.php?zone=settings parameter.

  • Critical 9.1

    Foreman: arbitrary code execution through templates

    An arbitrary code execution flaw was found in Foreman. This flaw allows an admin user to bypass safe mode in templates and execute arbitrary code on the underlying operating system.

  • Critical 9.3

    Improper Neutralization of Special Elements in Ormazabal products

    Operating system command injection in ekorCCP and ekorRCI, which could allow an authenticated attacker to execute commands, create new users with elevated privileges or set up a backdoor.

  • Critical 9.1

    Magento Commerce Widgets Update Layout XML Injection Vulnerability Could Lead To Remote Code Execution

    Magento Commerce versions 2.4.2 (and earlier), 2.4.2-p1 (and earlier) and 2.3.7 (and earlier) are affected by an XML Injection vulnerability in the Widgets Update Layout. An attacker with admin privileges can trigger a specially crafted script to achieve remo…

  • Critical 9.8

    Command Injection Vulnerability in find-exec

    find-exec is a utility to discover available shell commands. Versions prior to 1.0.3 did not properly escape user input and are vulnerable to Command Injection via an attacker controlled parameter. As a result, attackers may run malicious shell commands in th…

  • Critical 9.8

    SpotCam Co., Ltd. SpotCam Sense - Command Injection

    SpotCam Co., Ltd. SpotCam Sense’s hidden Telnet function has a vulnerability of OS command injection. An remote unauthenticated attacker can exploit this vulnerability to execute command injection attack to perform arbitrary system commands or disrupt service.

  • Critical 9.8

    OS command injection vulnerability in ELECOM wireless LAN routers allows an attacker who can access the product to exec…

  • Critical 9.9

    IBM Security Guardium command execution

    IBM Security Guardium 10.6, 11.3, 11.4, and 11.5 could allow a remote authenticated attacker to execute arbitrary commands on the system by sending a specially crafted request. IBM X-Force ID: 258824.

  • Critical 9.1

    When adding a remote backup location, an authenticated user can pass arbitrary OS commands through the username field. …

  • Critical 9.8

    GitPython vulnerable to remote code execution due to insufficient sanitization of input arguments

    GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. NOTE: this issue exists because of an incomplete fix for CVE-2022-24439.

  • Critical 9.1

    Validate Your Inputs | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (CWE-78)

    Adobe Commerce versions 2.4.6-p1 (and earlier), 2.4.5-p3 (and earlier) and 2.4.4-p4 (and earlier) are affected by an Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') vulnerability that could lead to arbitrary code exe…

  • Critical 10.0

    PHOENIX CONTACT: OS Command Injection in WP 6xxx Web panels

    In PHOENIX CONTACTs WP 6xxx series web panels in versions prior to 4.0.10 a remote, unauthenticated attacker may use an attribute of a specific HTTP POST request releated to date/time operations to gain full access to the device.

  • Critical 9.8

    Command injection vulnerability in module management function in CloudExplorer Lite

    CloudExplorer Lite is an open source, lightweight cloud management platform. Versions prior to 1.3.1 contain a command injection vulnerability in the installation function in module management. The vulnerability has been fixed in v1.3.1. There are no known wo…

  • Critical 9.6

    OS Command Injection in jgraph/drawio

    OS Command Injection in GitHub repository jgraph/drawio prior to 21.4.0.

  • Critical 9.6

    Command injection in fs.py

    PaddlePaddle before 2.5.0 has a command injection in fs.py. This resulted in the ability to execute arbitrary commands on the operating system.

  • Critical 9.8
    CVE-2023-37903 Public exploit

    Sandbox Escape in vm2

    vm2 is an open source vm/sandbox for Node.js. In vm2 for versions up to and including 3.9.19, Node.js custom inspect function allows attackers to escape the sandbox and run arbitrary code. This may result in Remote Code Execution, assuming the attacker has ar…

  • Critical 9.8

    HGiga iSherlock - Command Injection

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') vulnerability in HGiga iSherlock 4.5 (iSherlock-user modules), HGiga iSherlock 5.5 (iSherlock-user modules) allows OS Command Injection.This issue affects iSherlock 4.5…

  • Critical 9.1

    OS command injection vulnerability in SAP ECC and SAP S/4HANA (IS-OIL)

    Due to programming error in function module and report, IS-OIL component in SAP ECC and SAP S/4HANA allows an authenticated attacker to inject an arbitrary operating system command into an unprotected parameter in a common (default) extension.  On successful …