CVE-2025-61787
JSON

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 packageVersionsReported by
denoland deno>= 2.3.0, < 2.5.3, < 2.2.15CVE List
deno (crates.io)before 2.5.2GitHub Advisory Database
deno denoup to 2.2.15, from 2.3.0 before 2.5.3NVD

All scores

GitHub_M8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub8.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-77

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

Sources

SourceRecordLicence
CVE ListCVE-2025-61787 changed 2025-10-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-m2gf-x3f6-8hq3 changed 2025-10-08CC-BY-4.0
NVDCVE-2025-61787 changed 2026-10-08Public domain