diff --git a/advisories/github-reviewed/2025/01/GHSA-f27p-cmv8-xhm6/GHSA-f27p-cmv8-xhm6.json b/advisories/github-reviewed/2025/01/GHSA-f27p-cmv8-xhm6/GHSA-f27p-cmv8-xhm6.json new file mode 100644 index 00000000000..ced5e0c19fe --- /dev/null +++ b/advisories/github-reviewed/2025/01/GHSA-f27p-cmv8-xhm6/GHSA-f27p-cmv8-xhm6.json @@ -0,0 +1,95 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-f27p-cmv8-xhm6", + "modified": "2025-01-06T22:27:09Z", + "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": "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": null + } +} \ No newline at end of file