Skip to content

CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')

ClassLikelihood of exploit: High

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.

Many protocols and products have their own custom command language. While OS or shell command strings are frequently discovered and targeted, developers may not realize that these other command languages might also be vulnerable to attacks.

Consequences

  • Integrity, Confidentiality, Availability: Execute Unauthorized Code or Commands

How to prevent it

  • Architecture and Design: If at all possible, use library calls rather than external processes to recreate the desired functionality.
  • Implementation: If possible, ensure that all external commands called from the program are statically created.
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • Operation: Run time: Run time policy enforcement may be used in an allowlist fashion to prevent use of any non-sanctioned commands.
  • System Configuration: Assign permissions that prevent the user from accessing/opening privileged files.

Recent advisories

  • GHSA-587h-7wmj-h5pm — launch-editor: `fs.existsSync()` existence check can be bypassed on Windows
  • CVE-2026-96951 — Improper neutralization of special elements used in a command ('command injection') in Windows Shell allows an unauthorized attacker to bypass a security…
  • CVE-2026-105134 — A flaw has been found in Ahsay AhsayCBS up to 9.15.2.69/10.3.4.44.
  • GHSA-jf24-8g2h-2wg7 — LibreNMS Vulnerable to Remote Code Execution via AboutController
  • GHSA-c9fv-cgmm-2wg7 — LibreNMS Vulnerable to Remote Code Execution by Signal Alert Transportation module
  • GHSA-6qc3-v8fv-fv9j — Apache Ranger has a Command Injection vulnerability
  • GHSA-956x-8gvw-wg5v — GitPython: command injection via unguarded Git options in `Repo.archive()`, `git.ls_remote()`, and arbitrary file overwrite via `Repo.iter_commits()` / `Repo.blame()`
  • GHSA-qf6p-p7ww-cwr9 — Gogs vulnerable to RCE via git rebase --exec argument injection in pull request merge
  • GHSA-c969-5x3p-vq3v — PraisonAI: IMAP Command Injection via Unsanitized Email Search Parameters
  • GHSA-8c9q-7855-wfxq — File Browser has a Command Execution Allowlist Bypass via Shell Metacharacter Injection
  • GHSA-46q3-7gv7-qmgg — Net::IMAP: Command Injection via ID command argument
  • GHSA-8p34-64r3-mwg8 — Net::IMAP: Command Injection via non-synchronizing literal in "raw" argument
  • CVE-2026-8037 — OS Command Injection Remote Code Execution Vulnerability in API in Progress ADC Products allows an un-authenticated attacker to execute arbitrary commands on…
  • GHSA-c27g-q93r-2cwf — launch-editor vulnerable to command injection via the crafted request on Windows
  • GHSA-f26g-jm89-4g65 — gitoxide: CommandForbiddenInModulesConfiguration Bypass in gix_submodule::File::update() Enables Arbitrary Command Execution via .gitmodules

All advisories for CWE-77

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor