CVE-2025-21620: fetch Authorization Headers Not Dropped When Vulnerability

HIGH
Advisory Identifier: GHSA-f27p-cmv8-xhm6
CVSS 7.5
CWE-200
Published
Advisory Summary

CVE-2025-21620 is a HIGH (CVSS 7.5) authorization headers not dropped when vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting fetch libraries in the crates.io ecosystem. The issue involves authorization headers not dropped when redirecting cross-origin. Remediation is available by upgrading affected packages to version 0.204.0, 2.1.2.

CVE-2025-21620 at a Glance

CVE Identifier CVE-2025-21620
GHSA Identifier GHSA-f27p-cmv8-xhm6
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product fetch
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2025-21620

To remediate this vulnerability, upgrade all affected fetch dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

deno_fetch fixed: 0.204.0
Upgrade deno_fetch to 0.204.0
deno fixed: Latest secure release
Upgrade deno to Latest secure release
deno fixed: 2.1.2
Upgrade deno to 2.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for deno_fetch

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-21620, inspect your project dependencies for fetch:

inspect dependencies for deno_fetch

Analyze the terminal output to locate any version of fetch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.204.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In fetch, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2025-21620 Affected fetch Versions

3 component(s)
Fixed Versions:
0.204.02.1.2
Product / Package Ecosystem Affected Versions Fixed Version
deno_fetch
crates.io
≥ 0.0.1
< 0.204.0
0.204.0
deno
crates.io
≤ 1.46.3
deno
crates.io
≥ 2.0.0
< 2.1.2
2.1.2

References

Frequently Asked Questions

What is CVE-2025-21620?
CVE-2025-21620 is a security vulnerability in fetch involving Authorization headers not dropped when redirecting cross-origin under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which fetch versions are affected?
Affected versions include releases prior to 0.204.0, 2.1.2 across affected packages: deno_fetch, deno.
What version fixes CVE-2025-21620?
Upgrading to 0.204.0, 2.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is deno_fetch affected?
Yes, deno_fetch is affected in releases prior to 0.204.0. Upgrade your dependency to 0.204.0 or later.
Is deno affected?
Yes, deno is affected in releases prior to Latest secure release, 2.1.2. Upgrade your dependency to Latest secure release, 2.1.2 or later.
What is the CVSS score of CVE-2025-21620?
CVE-2025-21620 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2025-21620?
CVE-2025-21620 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check crates.io dependencies for CVE-2025-21620?
Run the dependency tree command: 'inspect dependencies for deno_fetch'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f27p-cmv8-xhm6",
  "modified" : "2025-01-07T02:52:55Z",
  "published" : "2025-01-06T22:27:09Z",
  "aliases" : [ "CVE-2025-21620" ],
  "summary" : "fetch: Authorization headers not dropped when redirecting cross-origin",
  "details" : "### Summary\nWhen 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.\n\n\n### Details\n\nThe [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\".\n\nThe [documentation](https://docs.deno.com/runtime/reference/web_platform_apis/#:~:text=Deno%20does%20not%20follow%20the,leaking%20authenticated%20data%20cross%20origin.) states: \n> 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 \n\n### Reproduction\n```ts\nconst ac = new AbortController()\n\nconst server1 = Deno.serve({ port: 3001, signal: ac.signal }, (req) => {\n  return new Response(null, {\n    status: 302,\n    headers: {\n      'location': 'http://localhost:3002/redirected'\n    },\n  })\n})\n\nconst server2 = Deno.serve({ port: 3002, signal: ac.signal }, (req) => {\n  const body = JSON.stringify({\n    url: req.url,\n    hasAuth: req.headers.has('authorization'),\n  })\n  return new Response(body, {\n    status: 200,\n    headers: {'content-type': 'application/json'},\n  })\n})\n\nasync function main() {\n  const response = await fetch(\"http://localhost:3001/\", {\n    headers: {authorization: 'Bearer foo'}\n  })\n  const body = await response.json()\n  \n  ac.abort()\n  \n  if (body.hasAuth) {\n    console.error('ERROR: Authorization header should not be present after cross-origin redirect')\n  } else {\n    console.log('SUCCESS: Authorization header is not present after cross-origin redirect')\n  }\n}\n\nsetTimeout(main, 500)\n```\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno_fetch"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.1"
      }, {
        "fixed" : "0.204.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.46.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deno"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/denoland/deno/security/advisories/GHSA-f27p-cmv8-xhm6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-21620"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/denoland/deno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-01-06T22:27:09Z",
    "nvd_published_at" : "2025-01-06T23:15:07Z"
  }
}