Summary
A high-severity command injection vulnerability in Deno on Windows affects node:child_process when shell execution is enabled and untrusted arguments are supplied. Because arguments may be escaped for the wrong shell type, an attacker could cause arbitrary operating system commands to run with the privileges of the Deno process.
Affected context
The issue occurs in Deno applications running on Windows that use node:child_process with the shell option and incorporate untrusted or insufficiently validated arguments. Risk depends on whether attacker-controlled data reaches a shell-backed process invocation and on the permissions available to the Deno process.
Exploit preconditions
- Attack surface: Deno's
node:child_processAPIs on Windows - Required access: Ability to influence arguments passed to a child-process invocation, typically through an application-controlled input path
- Trigger point: Starting a child process with shell execution enabled
- Why exploitation is possible: Argument escaping is performed for an incompatible shell type, allowing shell metacharacters or command syntax to be interpreted by the actual shell
Why this happens
The vulnerability results from a mismatch between the shell assumed by the argument-escaping logic and the shell that processes the command on Windows. This can cause data treated as an argument by application code to be reinterpreted as shell syntax. The behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.
Potential impact
- An attacker may execute arbitrary operating system commands
- The attacker could access or modify data available to the Deno process
- Application credentials or environment secrets may be exposed
- The host could be altered or used for further attacks
- Service availability could be affected
General mitigation guidance
Mitigation generally focuses on removing unnecessary shell interpretation and reducing the amount of untrusted data that reaches process-launching APIs.
Common defensive patterns include:
- Prefer direct executable and argument APIs that do not invoke a shell
- Avoid enabling shell execution for inputs influenced by users or external systems
- Use fixed command and argument allowlists instead of constructing command strings
- Validate inputs against strict type, format, and length constraints
- Keep untrusted data separate from executable command structure
- Run Deno processes with the minimum operating-system privileges and access they require
- Apply operating-system and container isolation where appropriate
How teams detect issues like this
Organizations can identify this weakness through:
- Static analysis rules for
node:child_processcalls using shell options - Searches for command strings or process arguments assembled from request, file, or environment data
- Code review checks for shell execution combined with concatenation or interpolation
- Policy enforcement that requires approved process-launching wrappers or argument allowlists
- Runtime monitoring of unusual child-process creation and command interpreter activity
Automated code review and security scanning tools may help flag potentially unsafe shell invocation patterns.

