Skip to content

Deno vulnerable to command Injection via incomplete shell metacharacter blocklist in node:child_process

High severity GitHub Reviewed Published Mar 12, 2026 in denoland/deno • Updated Mar 13, 2026

Package

cargo deno (Rust)

Affected versions

>= 2.7.0, < 2.7.2

Patched versions

2.7.2

Description

Summary

A command injection vulnerability exists in Deno's node:child_process polyfill (shell: true mode) that bypasses the fix
for CVE-2026-27190 (GHSA-hmh4-3xvx-q5hr). An attacker who controls arguments passed to spawnSync or spawn with shell: true can execute arbitrary OS commands, bypassing Deno's permission system.

Affected versions: Deno v2.7.0, v2.7.1

Details

The two-stage argument sanitization in transformDenoShellCommand (ext/node/polyfills/internal/child_process.ts) has a
priority bug: when an argument contains a $VAR pattern, it is wrapped in double quotes (L1290) instead of single quotes
(L1293). Double quotes in POSIX sh do not suppress backtick command substitution, allowing injected commands to execute.

Attack chain:

  1. escapeShellArg wraps the argument in single quotes (safe)
  2. op_node_parse_shell_args strips the single-quote delimiters during tokenization (raw argument exposed)
  3. Re-quoting detects $VAR pattern → applies double quotes
  4. Backtick payload inside double quotes executes via /bin/sh

Impact

OS Command Injection (CWE-78). Any application using node:child_process spawn/spawnSync with shell: true and
user-controlled arguments is vulnerable. Injected commands execute at the OS process level, outside Deno's permission
sandbox. Only --allow-run is required.

Mitigation

Avoid passing user-controlled input as arguments to spawn/spawnSync with shell: true. Use shell: false (the default)
instead, or validate/sanitize inputs before passing them.

References

@bartlomieju bartlomieju published to denoland/deno Mar 12, 2026
Published by the National Vulnerability Database Mar 12, 2026
Published to the GitHub Advisory Database Mar 13, 2026
Reviewed Mar 13, 2026
Last updated Mar 13, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(39th percentile)

Weaknesses

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

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 when it is sent to a downstream component. Learn more on MITRE.

CVE ID

CVE-2026-32260

GHSA ID

GHSA-4c96-w8v2-p28j

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.