Skip to content

GHSA-cpgj-f7g3-2pp2 CVE-2026-49859

Deno: `fetch()` API sandbox bypass via missing DNS resolution check

Medium crates.io
Severity
5.2 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.14%
Chance of exploitation in the next 30 days. Higher than 3.40% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-693 Protection Mechanism Failure
CWE-918 Server-Side Request Forgery (SSRF)
Fix
2.8.1
Upgrade deno to this version or later

Description

Summary

When fetch() was called, Deno checked the destination hostname against --deny-net rules but did not re-check the IP addresses that hostname resolved to. An attacker-controlled script could use a specially crafted domain name that passes the hostname check yet resolves to a denied IP, bypassing the network restriction entirely.

Impact

Code running under --deny-net could reach hosts that the user intended to block. In practice this means network isolation rules — for example, blocking access to localhost or internal services — could be silently circumvented by a malicious or compromised dependency.

A companion advisory covers the same class of issue in the WebSocket API.

Who is affected

Users who:

  • run untrusted or third-party code with deno run, and
  • rely on --deny-net to restrict which hosts that code can reach.

If you do not use --deny-net, or if you only run fully trusted code, you are not affected.

Workaround

No workaround is available short of upgrading. If upgrading immediately is not possible, avoid granting --allow-net to untrusted code that also has --deny-net restrictions you depend on for security.

Fix

The fetch() DNS resolver now performs a post-resolution check on every IP address before passing it to the HTTP connector, consistent with how Deno.connect already behaved.

Affected versions

crates.io

PackageVulnerableFixed in
deno
< 2.8.1
2.8.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

deno crates.io → 2.8.1

cargo
cargo update -p deno --precise 2.8.1

Severity breakdown

CVSS 3.1 5.2

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Weakness

CWE-693: Protection Mechanism Failure

The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.

CWE-918: Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-x2qc-cmh9-f4hf
Deno: Denial of service via non-ASCII bytes in WebSocket response headers
Medium Also affects deno
GHSA-8xpq-cjcf-3wh9
Deno: Permission Bypass via Unicode Normalization Mismatch on macOS (APFS)
High Also affects deno
GHSA-968w-xfqw-vp9q
Deno: BYONM module resolution allows `package.json` main path traversal to bypass `--allow-read` restrictions
Medium Also affects deno
GHSA-v8fw-85r8-5m23
Deno: Node TCPWrap numeric hostname aliases bypass --deny-net resolved-IP deny checks
Medium Also affects deno
GHSA-9xg4-qhm4-g43w
Deno: Miller-Rabin Primality Test Allows Zero Rounds
High Also affects deno
GHSA-7xh3-mhg9-jcw8
Deno: Command Injection via spawnSync & spawn on Windows
High Also affects deno
GHSA-4c8g-jvcx-v4hv
Deno: process.loadEnvFile() bypasses env permission checks and mutates process.env with only read access
Medium Also affects deno
GHSA-83pc-3rw9-qpwj
Deno: WebSocket API sandbox bypass via missing post-DNS check
Medium Also affects deno
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor