{"id":"CVE-2025-21620","aliases":["CVE-2025-21620","GHSA-f27p-cmv8-xhm6"],"related":[],"kind":"vulnerability","state":"published","title":"Deno's authorization headers not dropped when redirecting cross-origin","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Deno es un entorno de ejecución de JavaScript, TypeScript y WebAssembly con valores predeterminados seguros. Cuando envía una solicitud con el encabezado Authorization a un dominio y la respuesta solicita redirigir a un dominio diferente, la gestión de redireccionamiento fetch() de Deno gestiona una solicitud de redireccionamiento de seguimiento que conserva el encabezado Authorization original y filtra su contenido a ese segundo dominio. Esta vulnerabilidad se corrigió en 2.1.2.","source":"nvd"}],"published":"2025-01-06T22:26:40.723Z","modified":"2026-06-17T08:43:52.293Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":"< 2.1.2","status":"affected"}],"vendor":"denoland","product":"deno","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.0.1","status":"affected","fixed":"0.204.0"}],"ecosystem":"crates.io","package":"deno_fetch","purl":"pkg:cargo/deno_fetch","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.46.3"}],"ecosystem":"crates.io","package":"deno","purl":"pkg:cargo/deno","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.1.2"}],"ecosystem":"crates.io","package":"deno","purl":"pkg:cargo/deno","source":"ghsa"}],"references":[{"url":"https://github.com/denoland/deno/security/advisories/GHSA-f27p-cmv8-xhm6","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21620","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/denoland/deno","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-01-07T16:48:58.089Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-21620","url":"https://www.cve.org/CVERecord?id=CVE-2025-21620","licence":"CVE Terms of Use","modified":"2025-01-07T16:49:19.307Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f27p-cmv8-xhm6","url":"https://github.com/advisories/GHSA-f27p-cmv8-xhm6","licence":"CC-BY-4.0","modified":"2025-01-07T02:52:55.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-21620","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21620","licence":"Public domain","modified":"2026-06-17T08:43:52.293Z"}],"updatedAt":"2026-11-25T22:58:53.129Z","epss":{"score":0.00522,"percentile":0.45763,"date":"2026-12-01T12:00:22.000Z"}}