CVE-2026-22864 Overview
CVE-2026-22864 is a command injection vulnerability in Deno, a JavaScript, TypeScript, and WebAssembly runtime. The vulnerability exists in a security mechanism designed to prevent the spawning of Windows batch and shell files. A prior patch implemented an extension check that returns an error when a spawned path's extension matches .bat or .cmd. However, this check performs a case-sensitive comparison against lowercase literals, allowing attackers to bypass the protection by using alternate casing such as .BAT, .Bat, or other variations.
Critical Impact
Attackers can bypass Deno's security controls to spawn malicious Windows batch files, potentially leading to arbitrary command execution on the underlying system.
Affected Products
- Deno versions prior to 2.5.6
- Deno runtime on Windows operating systems
- Applications using Deno's process spawning functionality
Discovery Timeline
- 2026-01-15 - CVE CVE-2026-22864 published to NVD
- 2026-01-21 - Last updated in NVD database
Technical Details for CVE-2026-22864
Vulnerability Analysis
This vulnerability is classified under CWE-77 (Command Injection) and represents a security bypass in Deno's process spawning functionality. The core issue stems from an incomplete security check that was intended to prevent the execution of Windows batch files (.bat and .cmd) through Deno's spawn API.
The original security patch implemented a file extension validation to block potentially dangerous batch file executions. However, the implementation used a case-sensitive string comparison against lowercase string literals (.bat and .cmd). On Windows operating systems, file extensions are case-insensitive, meaning files with extensions like .BAT, .Bat, .CMD, or .Cmd are all valid and executable batch files.
This oversight allows an attacker to trivially bypass the security mechanism by simply changing the case of the file extension. Once bypassed, the attacker can execute arbitrary batch files, which can contain any Windows commands, effectively achieving command injection capabilities.
Root Cause
The root cause is an improper input validation flaw where the extension check performs a case-sensitive comparison in a context (Windows file system) that is inherently case-insensitive. The security check should have normalized the extension to a consistent case before comparison or used a case-insensitive comparison function.
Attack Vector
The attack vector is network-based and requires no privileges or user interaction. An attacker who can influence the file path passed to Deno's process spawning functions can bypass the batch file restriction by using mixed or uppercase file extensions. For example, if an application spawns processes based on user-supplied filenames, an attacker could provide a path like malicious.BAT instead of malicious.bat to circumvent the security check.
The vulnerability manifests in Deno's process spawning extension validation logic. When a spawn request is made with a file path, the runtime checks if the extension matches .bat or .cmd using direct string comparison. Because this comparison is case-sensitive, paths with alternate casing bypass the check entirely. For detailed technical information, see the GitHub Security Advisory GHSA-m3c4-prhw-mrx6.
Detection Methods for CVE-2026-22864
Indicators of Compromise
- Process creation events from Deno spawning batch files with non-standard casing (e.g., .BAT, .Bat, .CMD)
- Unexpected cmd.exe or batch interpreter processes as children of Deno processes
- Log entries showing file path arguments with mixed-case batch file extensions
- Anomalous command execution patterns originating from Deno runtime processes
Detection Strategies
- Monitor Windows process creation events for batch file executions originating from deno.exe parent processes
- Implement file system monitoring to detect creation of batch files with mixed-case extensions in application directories
- Enable verbose logging in Deno applications to capture spawn attempts and file paths
- Use endpoint detection rules to flag case-variant batch file extensions in process arguments
Monitoring Recommendations
- Configure SentinelOne to alert on suspicious process chains involving Deno and Windows command interpreters
- Implement application-level logging for all file path inputs that may be used in spawn operations
- Monitor for unusual patterns of batch file creation or modification in web-accessible directories
- Review Deno application permissions and restrict process spawning capabilities where possible
How to Mitigate CVE-2026-22864
Immediate Actions Required
- Upgrade Deno to version 2.5.6 or later immediately
- Audit applications for any user-controlled input that influences file paths in spawn operations
- Implement additional input validation to normalize and check file extensions in a case-insensitive manner
- Consider restricting Deno's --allow-run permission to specific executables only
Patch Information
Deno has released version 2.5.6 which addresses this vulnerability by implementing a case-insensitive comparison for batch file extensions. The fix ensures that all case variations of .bat and .cmd extensions are properly blocked.
For more information, see the Deno v2.5.6 Release Notes and the GitHub Security Advisory.
Workarounds
- If upgrading is not immediately possible, implement application-level validation to normalize file extensions to lowercase before passing to spawn functions
- Restrict Deno's permissions using --allow-run=<specific_executables> to limit which programs can be spawned
- Deploy network segmentation to limit the potential impact of command execution
- Use Web Application Firewalls or input filtering to block requests containing batch file extensions in any case
# Configuration example - Restrict Deno permissions to specific executables
deno run --allow-run=node,npm script.ts
# Alternatively, run without spawn permissions if not required
deno run --allow-read --allow-write --allow-net script.ts
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

