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

5,328 results · Feed

  • Critical 9.4
    CVE-2025-34161 Public exploit

    Coolify Git Repository Field Command Injection in Project Deployment Workflow

    Coolify versions prior to v4.0.0-beta.420.7 are vulnerable to a remote code execution vulnerability in the project deployment workflow. The platform allows authenticated users, with low-level member privileges, to inject arbitrary shell commands via the Git R…

  • Medium 4.4

    Cisco NXOS Software Command Injection Vulnerability

    A vulnerability in the CLI of Cisco NX-OS Software could allow an authenticated, local attacker to execute a command injection attack on the underlying operating system of an affected device. To exploit this vulnerability, the attacker must have valid user cr…

  • Medium 6.0

    Cisco UCS Manager Software Command Injection Vulnerability

    A vulnerability in the CLI of Cisco UCS Manager Software could allow an authenticated, local attacker with administrative privileges to read or create a file or overwrite any file on the file system of the underlying operating system of an affected device, in…

  • Medium 6.5

    Cisco UCS Manager Software Command Injection Vulnerability

    Multiple vulnerabilities in the CLI and web-based management interface of Cisco UCS Manager Software could allow an authenticated, remote attacker with administrative privileges to perform command injection attacks on an affected system and elevate privileges…

  • Medium 4.7
    CVE-2025-9528 EPSS 54%

    Linksys E1700 systemCommand os command injection

    A vulnerability was determined in Linksys E1700 1.0.0.4.003. This vulnerability affects the function systemCommand of the file /goform/systemCommand. Executing manipulation of the argument command can lead to os command injection. The attack may be launched r…

  • Critical 9.1
    CVE-2025-50989 EPSS 11%

    OPNsense before 25.1.8 contains an authenticated command injection vulnerability in its Bridge Interface Edit endpoint …

  • Medium 6.5

    The Calamaris log exporter CGI (/cgi-bin/logs.cgi/calamaris.dat) in IPFire 2.29 does not properly sanitize user-supplie…

  • Medium 4.7
    CVE-2025-9424 EPSS 15%

    Ruijie WS7204-A branch_import.php os command injection

    A vulnerability was identified in Ruijie WS7204-A 2017.06.15. Affected by this vulnerability is an unknown functionality of the file /itbox_pi/branch_import.php?a=branch_list. Such manipulation of the argument province leads to os command injection. The attac…

  • Medium 6.3

    DCN DCME-720 Web Management Backend ip_block.php os command injection

    A vulnerability was found in DCN DCME-720 9.1.5.11. This affects an unknown function of the file /usr/local/www/function/audit/newstatistics/ip_block.php of the component Web Management Backend. Performing manipulation of the argument ip results in os command…

  • High 8.1

    Roo-Code potential remote code execution via auto-execute command parsing flaw

    Roo Code is an AI-powered autonomous coding agent that lives in users' editors. In versions prior to 3.25.5, Roo-Code fails to properly handle process substitution and single ampersand characters in the command parsing logic for auto-execute commands. If a us…

  • Critical 9.8

    Mitsubishi Electric Europe smartRTU OS Command Injection

    A remote unauthenticated attacker who has bypassed authentication could execute arbitrary OS commands to disclose, tamper with, destroy or delete information in Mitsubishi Electric smartRTU, or cause a denial-of service condition on the product.

  • Medium 5.6

    wong2 mcp-cli oAuth provider.js redirectToAuthorization os command injection

    A flaw has been found in wong2 mcp-cli 1.13.0. Affected is the function redirectToAuthorization of the file /src/oauth/provider.js of the component oAuth Handler. This manipulation causes os command injection. The attack may be initiated remotely. The attack …

  • Medium 6.3

    Linksys RE6250/RE6300/RE6350/RE6500/RE7000/RE9000 addStaticRoute os command injection

    A security vulnerability has been detected in Linksys RE6250, RE6300, RE6350, RE6500, RE7000 and RE9000 1.0.013.001/1.0.04.001/1.0.04.002/1.1.05.003/1.2.07.001. This vulnerability affects the function addStaticRoute of the file /goform/addStaticRoute. Such ma…

  • High 7.0

    Configd Injection

    The StrongDM macOS client incorrectly processed JSON-formatted messages. Attackers could potentially modify macOS system configuration by crafting a malicious JSON message.

  • High 8.5

    The StrongDM Windows service incorrectly handled input validation. Authenticated attackers could potentially exploit th…

  • Critical 9.3
    CVE-2011-10026 Public exploit

    Spreecommerce < 0.50.x API RCE

    Spreecommerce versions prior to 0.50.x contain a remote command execution vulnerability in the API's search functionality. Improper input sanitation allows attackers to inject arbitrary shell commands via the search[instance_eval] parameter, which is dynamica…

  • Critical 9.3
    CVE-2010-20059 Public exploit

    FreeNAS < 0.7.2 rev 5543 exec_raw.php Arbitrary Command Execution

    FreeNAS 0.7.2 prior to revision 5543 includes an unauthenticated command‐execution backdoor in its web interface. The exec_raw.php script exposes a cmd parameter that is passed directly to the underlying shell without sanitation.

  • Medium 5.3

    neurobin shc Environment Variable shc.c make os command injection

    A security flaw has been discovered in neurobin shc up to 4.0.3. Impacted is the function make of the file src/shc.c of the component Environment Variable Handler. The manipulation results in os command injection. The attack is only possible with local access…

  • Medium 5.3

    neurobin shc Filename shc.c make os command injection

    A vulnerability was determined in neurobin shc up to 4.0.3. This vulnerability affects the function make of the file src/shc.c of the component Filename Handler. Executing manipulation can lead to os command injection. The attack can only be executed locally.…

  • Medium 6.5

    TOTOLINK A3002R v4.0.0-B20230531.1404 was discovered to contain multiple OS command injection vulnerabilities via the m…

  • High 7.1

    Claude Code's Permissive Default Allowlist Enables Unauthorized File Read and Network Exfiltration in Claude Code

    Claude Code is an agentic coding tool. Prior to version 1.0.4, it's possible to bypass the Claude Code confirmation prompts to read a file and then send file contents over the network without user confirmation due to an overly broad allowlist of safe commands…

  • High 7.3

    D-Link DIR-860L Simple Service Discovery Protocol cgibin ssdpcgi_main os command injection

    A vulnerability was identified in D-Link DIR-860L 2.04.B04. This affects the function ssdpcgi_main of the file htdocs/cgibin of the component Simple Service Discovery Protocol. The manipulation leads to os command injection. It is possible to initiate the att…

  • Medium 6.0

    A vulnerability in the CLI of Cisco Secure Firewall Management Center (FMC) Software and Cisco Secure Firewall Threat D…

  • Critical 9.8
    CVE-2025-8943 Public exploit Scanner template EPSS 75%

    Unsupervised OS command execution leads to remote code execution by unauthenticated network attackers

    The Custom MCPs feature is designed to execute OS commands, for instance, using tools like `npx` to spin up local MCP Servers. However, Flowise's inherent authentication and authorization model is minimal and lacks role-based access controls (RBAC). Furthermo…

  • Critical 9.8
    CVE-2025-43984 EPSS 25%

    An issue was discovered on KuWFi GC111 devices (Hardware Version: CPE-LM321_V3.2, Software Version: GC111-GL-LM321_V3.0…

  • Critical 10.0
    CVE-2011-10017 Public exploit

    Snort Report nmap.php/nbtscan.php RCE

    Snort Report versions < 1.3.2 contains a remote command execution vulnerability in the nmap.php and nbtscan.php scripts. These scripts fail to properly sanitize user input passed via the target GET parameter, allowing attackers to inject arbitrary shell comma…

  • Critical 9.4
    CVE-2012-10059 Public exploit

    Dolibarr ERP/CRM Post-Auth OS Command Injection

    Dolibarr ERP/CRM versions <= 3.1.1 and <= 3.2.0 contain a post-authenticated OS command injection vulnerability in its database backup feature. The export.php script fails to sanitize the sql_compat parameter, allowing authenticated users to inject arbitrary …

  • High 7.8

    NVIDIA WebDataset for all platforms contains a vulnerability where an attacker could execute arbitrary code with elevat…

  • Critical 9.7

    Cherry Studio RCE Vulnerability Disclosure

    Cherry Studio is a desktop client that supports for multiple LLM providers. In version 1.5.1, a remote code execution (RCE) vulnerability exists in the Cherry Studio platform when connecting to streamableHttp MCP servers. The issue arises from the server’s im…

  • High 7.7

    Cherry Studio is Vulnerable to OS Command Injection during Connection with a Malicious MCP Server

    Cherry Studio is a desktop client that supports for multiple LLM providers. From versions 1.2.5 to 1.5.1, Cherry Studio is vulnerable to OS Command Injection during a connection with a malicious MCP server in HTTP Streamable mode. Attackers can setup a malici…

  • Medium 6.5
    CVE-2025-50946 Public exploit

    OliveTin OS Command Injection vulnerability

    OS Command Injection in Olivetin 2025.4.22 Custom Themes via the ParseRequestURI function in service/internal/executor/arguments.go.

  • Medium 6.5

    The /goform/formJsonAjaxReq POST endpoint of Shenzhen Tuoshi NR500-EA RG500UEAABxCOMSLICv3.4.2731.16.43 devices mishand…

  • Medium 6.5

    A improper neutralization of special elements used in an os command ('os command injection') vulnerability [CWE-78] in …

  • Medium 6.7

    An improper neutralization of special elements used in an OS command ('OS Command Injection') vulnerability [CWE-78] in…

  • Medium 6.6

    An improper neutralization of special elements used in an OS Command ("OS Command Injection") vulnerability [CWE-78] in…

  • Critical 9.8
    CVE-2025-25256 Public exploit Scanner template EPSS 65%

    An improper neutralization of special elements used in an OS command ('OS Command Injection') vulnerability [CWE-78] vu…

  • Critical 9.4
    CVE-2012-10040 Public exploit

    Openfiler v2.x NetworkCard Command Execution

    Openfiler v2.x contains a command injection vulnerability in the system.html page. The device parameter is used to instantiate a NetworkCard object, whose constructor in network.inc calls exec() with unsanitized input. An authenticated attacker can exploit th…

  • Critical 9.4
    CVE-2012-10039 Public exploit

    ZEN Load Balancer Filelog Command Execution

    ZEN Load Balancer versions 2.0 and 3.0-rc1 contain a command injection vulnerability in content2-2.cgi. The filelog parameter is passed directly into a backtick-delimited exec() call without sanitation. An authenticated attacker can inject arbitrary shell com…

  • Critical 9.3
    CVE-2012-10037 Public exploit

    PhpTax pfilez Parameter Exec Remote Code Injection

    PhpTax version 0.8 contains a remote code execution vulnerability in drawimage.php. The pfilez GET parameter is unsafely passed to the exec() function without sanitization. A remote attacker can inject arbitrary shell commands, leading to code execution under…

  • Medium 6.3

    Linksys RE6250/RE6300/RE6350/RE6500/RE7000/RE9000 setWan sub_3517C os command injection

    A vulnerability has been found in Linksys RE6250, RE6300, RE6350, RE6500, RE7000 and RE9000 up to 20250801. Affected by this issue is the function sub_3517C of the file /goform/setWan. The manipulation of the argument Hostname leads to os command injection. T…