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

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.

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-03-13 20:02:18 UTC
Updated
2026-03-13 20:02:20 UTC
GitHub reviewed
2026-03-13 20:02:18 UTC
NVD published
2026-03-12

EPSS Score

Score Percentile
0.10% 27.64%

CVSS Scores

Base score Version Severity Vector
8.1 3.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.

Identifiers

CWEs

CWE id Name
CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Credits

  • rtvkiz (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
rust deno >= 2.7.0, < 2.7.2 2.7.2

References

cvelogic Threat Intelligence