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,327 results · Feed

  • High 8.8

    An issue in MitraStar GPT-2742GX4X5v6-SV GL_g2.5_100XNT0b23_3 allows an authenticated attacker to execute arbitrary cod…

  • Medium 6.3

    IBM i Access Client Solutions (ACS) is Affected By Multiple Vulnerabilities

    IBM i Access Family 1.1.2.0 through 1.1.9.15 IBM i Access Client Solutions could allow an authenticated user to execute arbitrary commands with normal user privileges on the system due to improper validation of user supplied input in a STRPCCMD CL command.

  • Medium 6.3

    IBM i Access Client Solutions (ACS) is Affected By Multiple Vulnerabilities

    IBM i Access Family 1.1.2.0 through 1.1.9.15 IBM i Access Client Solutions could allow an authenticated user to execute arbitrary commands with normal user privileges on the system due to improper validation of user supplied input in a malicious emulator macr…

  • Medium 6.3

    IBM i Access Client Solutions (ACS) is Affected By Multiple Vulnerabilities

    IBM i Access Family 1.1.2.0 through 1.1.9.15 could allow an authenticated user to execute arbitrary commands with normal user privileges on the system due to improper validation of user supplied input in a session file.

  • High 8.8

    DataStage on Cloud Pak for Data has several vulnerabilities due to open source software

    IBM DataStage on Cloud Pak for Data 5.4.0.0 IBM DataStage could allow a remote authenticated attacker to execute arbitrary commands due to os command injection.

  • High 8.8

    DataStage on Cloud Pak for Data has several vulnerabilities due to open source software

    IBM DataStage on Cloud Pak for Data 5.4.0.0 IBM DataStage could allow a remote authenticated attacker to execute arbitrary OS commands due to improper neutralization of special characters in the PxPeek name property.

  • High 7.8

    IBM App Connect Enterprise Toolkit is vulnerable to arbitrary code execution due to multiple CVEs

    IBM App Connect Enterprise 13.0.1.0 through 13.0.8.0, and 12.0.1.0 through 12.0.12.27 could allow a local attacker to execute arbitrary code due to improper neutralization of special elements used in an OS command.

  • High 8.1

    backpack/crud: OS command injection in Stats::makeCurlRequest via attacker-controlled Host header (pre-auth)

    backpack/crud provides Create, Read, Update & Delete (CRUD) functions for Backpack, a collection of Laravel packages that help users build custom administration panels. Prior to 4.1.70, 5.6.2, 6.8.13, and 7.0.36, Backpack\CRUD\Stats::makeCurlRequest in src/St…

  • High 7.5

    Argos JavaScript: CI Branch Name OS Command Injection in @argos-ci/core

    Argos JavaScript provides official Argos SDKs for JavaScript. Prior to Argos core package version 6.2.1, attacker-controlled CI branch or ref values from GITHUB_HEAD_REF or ARGOS_BRANCH can flow through config.branch and getMergeBaseCommitSha() when hasRemote…

  • Critical 9.8

    PraisonAI UI MCP connect endpoint allows unauthenticated local command execution

    PraisonAI is a multi-agent teams system. Prior to 4.6.59, the default UI host applications expose POST /api/mcp/connect without mandatory authentication and accept caller-controlled command and args values that PraisonAIUI passes to StdioMCPClient to start a …

  • Medium 4.7

    magicblack MacCMS10 Template .%40template%40default%40html%40label.html os command injection

    A security flaw has been discovered in magicblack MacCMS10 2026.1000.4055. Affected by this vulnerability is an unknown functionality of the file /admin1.php/admin/template/index/path/.%40template%40default%40html%40label.html of the component Template Handle…

  • Medium 6.6

    D-Link DWR-M921 formWsc os command injection

    A vulnerability was identified in D-Link DWR-M921 1.1.52. This impacts the function formWsc of the file /boafrm/formWsc. The manipulation of the argument targetAPSsid leads to os command injection. The attack is possible to be carried out remotely. The exploi…

  • Medium 6.6

    D-Link DWR-M921 Boa Dispatch Table formsysCmd os command injection

    A vulnerability was determined in D-Link DWR-M921 1.1.52. This affects the function formsysCmd of the file /boafrm/formsysCmd of the component Boa Dispatch Table. Executing a manipulation of the argument sysCmd can lead to os command injection. The attack can…

  • High 7.8

    Parallels Desktop local privilege escalation via appliance extract argument injection

    Parallels Desktop runs prl_disp_service as root. Local clients reach it on the world-writable socket /var/run/prl_disp_service.socket. PrlSrv_LoginLocal accepts peer credentials. No Parallels signature. No admin group. After login, PrlSrv_InstallAppliance let…

  • Critical 9.1

    D-Link DWR-M921 formDiskCreateShare system os command injection

    A vulnerability has been found in D-Link DWR-M921 1.1.52. The affected element is the function system of the file /boafrm/formDiskCreateShare. Such manipulation of the argument folderpath leads to os command injection. The attack may be launched remotely. The…

  • Critical 9.1

    D-Link DWR-M921 formDiskFormat system os command injection

    A flaw has been found in D-Link DWR-M921 1.1.52. Impacted is the function system of the file /boafrm/formDiskFormat. This manipulation of the argument partition causes os command injection. The attack may be initiated remotely. The exploit has been published …

  • Critical 9.9

    D-Link DWR-M920 formPinManageSetup sub_41E60C os command injection

    A weakness has been identified in D-Link DWR-M920 1.1.7. This issue affects the function sub_41E60C of the file /boafrm/formPinManageSetup. This manipulation of the argument newPin causes os command injection. The attack can be initiated remotely. The exploit…

  • High 8.8

    SolarView Compact contains an OS command Injection vulnerability in in Schedule Settings. If this vulnerability is expl…

  • High 8.8

    Improper neutralization of special elements used in an OS command ('OS Command Injection') issue exists in Contec CAN 2…

  • High 8.8

    Improper neutralization of special elements used in an OS command ('OS Command Injection') issue exists in CONPROSYS TM…

  • High 8.8

    Improper neutralization of special elements used in an OS command ('OS Command Injection') issue exists in CONPROSYS PA…

  • High 8.8

    Improper neutralization of special elements used in an OS command ('OS Command Injection') issue exists in CONPROSYS M2…

  • High 8.8

    Improper neutralization of special elements used in an OS command ('OS Command Injection') issue exists in SGA1000. If …

  • High 8.8

    Improper neutralization of special elements used in an OS command ('OS Command Injection') issue exists in Contec FX500…

  • High 7.3

    0x4m4 HexStrike AI API Tools Endpoint hexstrike_server.py subprocess.Popen os command injection

    A weakness has been identified in 0x4m4 HexStrike AI up to d689933ff579d839c676c82b231f8e98326c5f04. The affected element is the function subprocess.Popen of the file hexstrike_server.py of the component API Tools Endpoint. Executing a manipulation of the arg…

  • Medium 6.3

    ipa-lab HackingBuddyGPT ssh_run_command.py ssh_run_command os command injection

    A vulnerability was identified in ipa-lab HackingBuddyGPT up to 0.5.0. This affects the function ssh_run_command of the file src/hackingBuddyGPT/extensions/ssh_run_command.py. Such manipulation leads to os command injection. The attack can be launched remotel…

  • High 7.3

    0x4m4 HexStrike AI Execute Endpoint hexstrike_server.py os command injection

    A vulnerability has been found in 0x4m4 HexStrike AI up to d689933ff579d839c676c82b231f8e98326c5f04. Impacted is an unknown function of the file hexstrike_server.py of the component Execute Endpoint. The manipulation of the argument code/script leads to os co…

  • High 7.3

    GH05TCREW PentestAgent LocalRuntime runtime.py LocalRuntime.execute_command os command injection

    A flaw has been found in GH05TCREW PentestAgent up to cf882dabea3ed91cef016cdd115e5426315665a2. This issue affects the function LocalRuntime.execute_command of the file runtime/runtime.py of the component LocalRuntime. Executing a manipulation can lead to os …

  • High 7.3

    GH05TCREW PentestAgent MCP HTTP Server main.py run_task os command injection

    A vulnerability was detected in GH05TCREW PentestAgent up to cf882dabea3ed91cef016cdd115e5426315665a2. This vulnerability affects the function run_task of the file interface/main.py of the component MCP HTTP Server. Performing a manipulation results in os com…

  • High 8.8

    Spug through 3.4.0 Remote Code Execution via ping_check

    Spug through 3.4.0 contains a remote code execution vulnerability in the ping_check function that interpolates user-supplied monitor addresses directly into shell commands without validation. Authenticated users with monitor permissions can inject shell metac…

  • Medium 6.3

    webgjc web_robot web.py controller_recover os command injection

    A security vulnerability has been detected in webgjc web_robot 2.4.0/2.5.0/2.8.0. The affected element is the function controller_listen/controller_recover of the file py/web.py. The manipulation of the argument case_name leads to os command injection. It is …

  • Low 3.1

    A Command Injection vulnerability exists in the bs_SetLimitCli_info function within the libshare.so library of the LB-L…

  • High 8.8

    OS Command Injection in Malcolm

    A file-transfer interface that requires valid credentials accepts attacker-controlled filenames without restricting shell metacharacters. An automated process later constructs and runs a system command using the uploaded file's name, allowing an authenticated…

  • High 7.8

    OS command injection in the task synthesis component in projen

    Improper neutralization of special elements used in an OS command in the task synthesis component in projen before 0.103.0 might allow context-dependent attackers to execute arbitrary commands on a developer workstation or continuous integration runner via sh…

  • High 8.4

    OS Command Injection in TUBITAK BILGEM's Pardus Software

    Improper neutralization of special elements used in an OS command ('OS command injection') vulnerability in TUBITAK BILGEM Software Technologies Research Institute Pardus Software allows OS Command Injection. This issue affects Pardus Software: before 1.0.5.

  • Critical 9.8

    WAVLINK WN535M1/WN535M3 Unauthenticated OS Command Injection via sync_server

    WAVLINK WN535M1 and WN535M3 routers running firmware prior to M35M1_V250922 contain an unauthenticated OS command injection vulnerability that allows remote attackers to execute arbitrary commands as root by sending crafted filenames to the sync_server daemon…

  • High 7.8

    OS Command Injection in TUBITAK BILGEM's Pardus-boot-repair

    Improper neutralization of special elements used in an OS command ('OS command injection') vulnerability in TUBITAK BILGEM Software Technologies Research Institute Pardus Boot Repair allows OS Command Injection. This issue affects Pardus Boot Repair: before 1…

  • High 8.6

    Command Injection in Puppet Enterprise

    Affected versions of Puppet Enterprise contain a command injection vulnerability. An authenticated user with Puppet administrative privileges can inject arbitrary shell commands by providing a specially crafted value for this parameter, which is passed to a s…

  • High 7.7
    CVE-2026-17176 EPSS 15%

    OS Command Injection Vulnerability in Deco Devices

    An OS command injection vulnerability in the TDDP module of Deco BE11000 and Deco M9 Plus allows an adjacent network attacker to execute arbitrary commands with root privileges by sending a crafted UDP packet. Successful exploitation may lead to complete devi…

  • High 8.8

    Langflow is vulnerable to arbitrary code execution due to multiple incomplete code security controls and missing execution guards

    IBM Langflow OSS 1.0.0 through 1.11.5 could allow an authenticated attacker to execute arbitrary code due to an incomplete denylist in the security scanner.