CVE-2025-61787

8.1 HIGH

📋 TL;DR

This CVE describes a command injection vulnerability in Deno on Windows systems. When Deno executes batch files (.bat, .cmd) on Windows, the underlying CreateProcess() function implicitly spawns cmd.exe, allowing attackers to inject arbitrary commands. This affects Deno users on Windows who execute batch files through Deno's APIs.

💻 Affected Systems

Products:
  • Deno
Versions: All versions prior to 2.5.3 and 2.2.15
Operating Systems: Windows
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Windows systems when executing batch files through Deno APIs. Linux/macOS systems are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with arbitrary command execution as the Deno process user, potentially leading to data theft, ransomware deployment, or complete system takeover.

🟠

Likely Case

Limited command execution within the Deno process context, potentially allowing file system access, data exfiltration, or lateral movement within the network.

🟢

If Mitigated

No impact if proper input validation and sandboxing are implemented, or if batch file execution is avoided.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires the ability to control or influence batch file execution through Deno APIs. The vulnerability is in the Windows CreateProcess() behavior when handling batch files.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.5.3 or 2.2.15

Vendor Advisory: https://github.com/denoland/deno/security/advisories/GHSA-m2gf-x3f6-8hq3

Restart Required: Yes

Instructions:

1. Check current Deno version with 'deno --version'. 2. Update to Deno 2.5.3 or 2.2.15 using 'deno upgrade --version 2.5.3' or 'deno upgrade --version 2.2.15'. 3. Restart all Deno processes and applications.

🔧 Temporary Workarounds

Avoid batch file execution

windows

Prevent Deno from executing batch files by modifying application code to avoid batch file execution APIs.

Implement input validation

all

Add strict input validation and sanitization for any user-controlled parameters passed to Deno's execution APIs.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all user inputs that could affect batch file execution
  • Run Deno processes with minimal privileges and in isolated environments/sandboxes

🔍 How to Verify

Check if Vulnerable:

Check if Deno version is below 2.5.3 or 2.2.15 on Windows systems

Check Version:

deno --version

Verify Fix Applied:

Verify Deno version is 2.5.3 or 2.2.15 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unexpected cmd.exe spawns from Deno processes
  • Unusual batch file execution patterns
  • Deno process spawning unexpected child processes

Network Indicators:

  • Outbound connections from Deno processes to unexpected destinations
  • Command and control traffic patterns

SIEM Query:

Process creation where parent_process contains 'deno' and process contains 'cmd.exe'

🔗 References

📤 Share & Export