{"id":"CVE-2025-21620","aliases":["EUVD-2025-0024","GHSA-f27p-cmv8-xhm6"],"status":"published","title":"Deno's authorization headers not dropped when redirecting cross-origin","description":"Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. When you send a request with the Authorization header to one domain, and the response asks to redirect to a different domain, Deno'sfetch() redirect handling creates a follow-up redirect request that keeps the original Authorization header, leaking its content to that second domain. This vulnerability is fixed in 2.1.2.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00522,"percentile":0.44736,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-200"],"published":"2025-01-06T22:26:40Z","modified":"2026-10-28T02:31:14Z","fixes":[{"ecosystem":"crates.io","package":"deno_fetch","fixed_in":["0.204.0"],"sources":["ghsa","osv"]},{"ecosystem":"crates.io","package":"deno","fixed_in":["2.1.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"deno_fetch","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.1"},{"fixed":"0.204.0"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"deno","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.46.3"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"deno","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"2.1.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"deno_fetch","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.1"},{"fixed":"0.204.0"}]}]},{"source":"osv","ecosystem":"crates.io","package":"deno","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"1.46.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"deno","ranges":[{"type":"SEMVER","events":[{"introduced":"2.0.0"},{"fixed":"2.1.2"}]}]}],"products":[{"vendor":"denoland","product":"deno"}],"references":[{"url":"https://github.com/denoland/deno/security/advisories/GHSA-f27p-cmv8-xhm6","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21620","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-f27p-cmv8-xhm6"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21620.json","tags":["advisory"]},{"url":"https://github.com/denoland/deno","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-21620","title":"Deno's authorization headers not dropped when redirecting cross-origin","description":"Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. When you send a request with the Authorization header to one domain, and the response asks to redirect to a different domain, Deno'sfetch() redirect handling creates a follow-up redirect request that keeps the original Authorization header, leaking its content to that second domain. This vulnerability is fixed in 2.1.2.","status":"published","published":"2025-01-06T22:26:40.723Z","modified":"2025-01-07T16:49:19.307Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:32:32.30152Z"}],"euvd":[{"id":"EUVD-2025-0024","description":"Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. When you send a request with the Authorization header to one domain, and the response asks to redirect to a different domain, Deno'sfetch() redirect handling creates a follow-up redirect request that keeps the original Authorization header, leaking its content to that second domain. This vulnerability is fixed in 2.1.2.","status":"published","published":"2025-01-06T22:26:40Z","modified":"2025-01-07T16:49:19Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-03T00:04:24.776491Z"}],"ghsa":[{"id":"GHSA-f27p-cmv8-xhm6","title":"fetch: Authorization headers not dropped when redirecting cross-origin","description":"### 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\u003e 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) =\u003e {\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) =\u003e {\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","status":"published","published":"2025-01-06T22:27:09Z","modified":"2025-01-07T02:52:56Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:38:26.167657Z"}],"nvd":[{"id":"CVE-2025-21620","description":"Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. When you send a request with the Authorization header to one domain, and the response asks to redirect to a different domain, Deno'sfetch() redirect handling creates a follow-up redirect request that keeps the original Authorization header, leaking its content to that second domain. This vulnerability is fixed in 2.1.2.","status":"published","published":"2025-01-06T23:15:07.77Z","modified":"2026-06-17T08:43:52.293Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"secondary"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T14:10:48.373347Z"}],"osv":[{"id":"CVE-2025-21620","title":"Deno's authorization headers not dropped when redirecting cross-origin","description":"Deno is a JavaScript, TypeScript, and WebAssembly runtime with secure defaults. When you send a request with the Authorization header to one domain, and the response asks to redirect to a different domain, Deno'sfetch() redirect handling creates a follow-up redirect request that keeps the original Authorization header, leaking its content to that second domain. This vulnerability is fixed in 2.1.2.","status":"published","published":"2025-01-06T22:26:40.723Z","modified":"2026-10-28T02:31:14.506793777Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T15:44:46.665428Z"},{"id":"GHSA-f27p-cmv8-xhm6","title":"fetch: Authorization headers not dropped when redirecting cross-origin","description":"### 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\u003e 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) =\u003e {\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) =\u003e {\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","status":"published","published":"2025-01-06T22:27:09Z","modified":"2025-01-07T02:52:55Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-200"],"updated_at":"2026-11-02T15:46:45.639885Z"}]}}
