Loading...
Skip to main content

CVE-2025-21620 — Vulnerability in deno_fetch — CVE Details

HIGH

fetch: Authorization headers not dropped when redirecting cross-origin

Published January 6, 2025Updated January 7, 2025Source: osv

Summary

### Summary When you send a request with the `Authorization` header to one domain, and the response asks to redirect to a different domain, Deno's`fetch()` redirect handling creates a follow-up redirect request that keeps the original `Authorization` header, leaking its content to that second domain. ### Details The [right behavior](https://fetch.spec.whatwg.org/#ref-for-cors-non-wildcard-request-header-name) would be to drop the `Authorization` header instead, in this scenario. The same is generally applied to `Cookie` and `Proxy-Authorization` headers, and is done for not only host changes, but also protocol/port changes. Generally referred to as "origin". The [documentation](https://docs.deno.com/runtime/reference/web_platform_apis/#:~:text=Deno%20does%20not%20follow%20the,leaking%20authenticated%20data%20cross%20origin.) states: > Deno does not follow the same-origin policy, because the Deno user agent currently does not have the concept of origins, and it does not have a cookie jar. This means Deno **does not need** to protect against leaking authenticated data cross origin ### Reproduction ```ts const ac = new AbortController() const server1 = Deno.serve({ port: 3001, signal: ac.signal }, (req) => { return new Response(null, { status: 302, headers: { 'location': 'http://localhost:3002/redirected' }, }) }) const server2 = Deno.serve({ port: 3002, signal: ac.signal }, (req) => { const body = JSON.stringify({ url: req.url, hasAuth: req.headers.has('authorization'), }) return new Response(body, { status: 200, headers: {'content-type': 'application/json'}, }) }) async function main() { const response = await fetch("http://localhost:3001/", { headers: {authorization: 'Bearer foo'} }) const body = await response.json() ac.abort() if (body.hasAuth) { console.error('ERROR: Authorization header should not be present after cross-origin redirect') } else { console.log('SUCCESS: Authorization header is not present after cross-origin redirect') } } setTimeout(main, 500) ```

Advisory Timeline

  • First published January 6, 2025 (643 days ago).
  • Last revised January 7, 2025 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update deno_fetch to 0.204.0 or later
cargo update -p deno_fetch --precise 0.204.0
Cargo
Update deno to 2.1.2 or later
cargo update -p deno --precise 2.1.2

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: crates.io (2).

PackageEcosystemAffectedFixed In
deno_fetch
crates.io
All versions0.204.0
deno
crates.io
All versions2.1.2
deno
crates.io
All versionsRange-based data available

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-200
    Information ExposureMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2025-21620?
fetch: Authorization headers not dropped when redirecting cross-origin This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2025-21620?
CVE-2025-21620 affects deno_fetch and deno. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-21620 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-f27p-cmv8-xhm6

Related CVEs

  • CVE-2021-32619
    CRITICAL

    Deno's static imports inside dynamically imported modules do not adhere to permission checks

  • CVE-2024-34346
    HIGH

    Deno permission escalation vulnerability via open of privileged files with missing `--deny` flag

  • CVE-2025-24015
    HIGH

    Deno's AES GCM authentication tags are not verified

  • CVE-2024-27934
    HIGH

    *const c_void / ExternalPointer unsoundness leading to use-after-free

  • CVE-2023-33966
    HIGH

    Missing "--allow-net" permission check for built-in Node modules

  • CVE-2023-28446
    HIGH

    Interactive `run` permission prompt spoofing via improper ANSI neutralization

  • CVE-2024-27935
    HIGH

    Deno's Node.js Compatibility Runtime has Cross-Session Data Contamination

  • CVE-2026-49411
    MEDIUM

    Deno: Node TCPWrap numeric hostname aliases bypass --deny-net resolved-IP deny checks

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies