8.1high
Deno is Vulnerable to Command Injection on Windows During Batch File Execution
- Severity
- 8.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 2.16% (higher than 82% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-m2gf-x3f6-8hq3
Description
Deno is a JavaScript, TypeScript, and WebAssembly runtime. Versions prior to 2.5.3 and 2.2.15 are vulnerable to Command Line Injection attacks on Windows when batch files are executed. In Windows, ``CreateProcess()`` always implicitly spawns ``cmd.exe`` if a batch file (.bat, .cmd, etc.) is being executed even if the application does not specify it via the command line. This makes Deno vulnerable to a command injection attack on Windows. Versions 2.5.3 and 2.2.15 fix the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| denoland deno | >= 2.3.0, < 2.5.3, < 2.2.15 | CVE List |
| deno (crates.io) | before 2.5.2 | GitHub Advisory Database |
| deno deno | up to 2.2.15, from 2.3.0 before 2.5.3 | NVD |
All scores
| GitHub_M | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
Deno is a JavaScript, TypeScript, and WebAssembly runtime. Versions prior to 2.5.3 and 2.2.15 are vulnerable to Command Line Injection attacks on Windows when batch files are executed. In Windows, ``CreateProcess()`` always implicitly spawns ``cmd.exe`` if a batch file (.bat, .cmd, etc.) is being executed even if the application does not specify it via the command line. This makes Deno vulnerable to a command injection attack on Windows. Versions 2.5.3 and 2.2.15 fix the issue.
GitHub Advisory Database
Summary
Deno versions up to 2.5.1 are vulnerable to Command Line Injection attacks on Windows when batch files are executed.
Details
In Windows, CreateProcess() always implicitly spawns cmd.exe if a batch file (.bat, .cmd, etc.) is being executed even if the application does not specify it via the command line. This makes Deno vulnerable to a command injection attack on Windows as demonstrated by the two proves-of-concept below.
PoC
Using node:child_process (with the env and run permissions):
const { spawn } = require('node:child_process');
const child = spawn('./test.bat', ['&calc.exe']);
Using Deno.Command.spawn() (with the run permission):
const command = new Deno.Command('./test.bat', {
args: ['&calc.exe'],
});
const child = command.spawn();
Impact
Both of these scripts result in opening calc.exe on Windows, thus allowing a Command Line Injection attack when user-provided arguments are passed if the script being executed by the child process is a batch script.
NVD (es)
Deno es un entorno de ejecución de JavaScript, TypeScript y WebAssembly. Las versiones anteriores a la 2.5.3 y 2.2.15 son vulnerables a ataques de inyección de línea de comandos en Windows cuando se ejecutan archivos por lotes. En Windows, 'CreateProcess()' siempre genera implícitamente 'cmd.exe' si se está ejecutando un archivo por lotes (.bat, .cmd, etc.), incluso si la aplicación no lo especifica a través de la línea de comandos. Esto hace que Deno sea vulnerable a un ataque de inyección de comandos en Windows. Las versiones 2.5.3 y 2.2.15 solucionan el problema.
References
| https://github.com/denoland/deno/security/advisories/GHSA-m2gf-x3f6-8hq3 | exploit, vendor-advisory, web | |
| https://github.com/denoland/deno/pull/30818 | issue-tracking, patch, web | |
| https://github.com/denoland/deno/commit/8a0990ccd37bafd8768176ca64b906ba2da2d822 | patch, web | |
| https://github.com/denoland/deno/releases/tag/v2.2.15 | release-notes, web | |
| https://github.com/denoland/deno/releases/tag/v2.5.3 | release-notes | |
| https://nvd.nist.gov/vuln/detail/CVE-2025-61787 | advisory | |
| https://github.com/denoland/deno | package | |
| https://github.com/denoland/deno/releases/tag/v2.5.2 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-61787 changed 2025-10-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m2gf-x3f6-8hq3 changed 2025-10-08 | CC-BY-4.0 |
| NVD | CVE-2025-61787 changed 2026-10-08 | Public domain |