# CVE-2025-21620: Deno's authorization headers not dropped when redirecting cross-origin

> Deno leaks Authorization headers to cross-origin domains during redirects, exposing sensitive credentials to unintended recipients.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Jan 2025
- **Updated:** 7 Jan 2025
- **Also known as:** GHSA-f27p-cmv8-xhm6

## What is CVE-2025-21620?

CVE-2025-21620 is a high-severity vulnerability in denoland deno, published on 6 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2025-21620?

6 open source packages ship an affected version, including deno and deno_fetch.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `deno` | crates.io | All versions to 1.46.3 | None |
| `deno` | crates.io | All versions to 1.46.3 | None |
| `deno` | crates.io | From 2.0.0 | 2.1.2 |
| `deno` | crates.io | From 2.0.0 | 2.1.2 |
| `deno_fetch` | crates.io | From 0.0.1 | 0.204.0 |
| `deno_fetch` | crates.io | From 0.0.1 | 0.204.0 |

## How do I fix CVE-2025-21620?

Upgrade deno to 2.1.2 or later.

## Is CVE-2025-21620 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-21620 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-21620 and fix it if it is affected.

What it is: CVE-2025-21620 is a high-severity vulnerability in denoland deno, published on 6 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-21620 exists.

Affected packages and fixed versions:
- deno (crates.io): affected all versions up to 1.46.3; no fix listed
- deno (crates.io): affected all versions up to 1.46.3; no fix listed
- deno (crates.io): affected from 2.0.0; fixed in 2.1.2
- deno (crates.io): affected from 2.0.0; fixed in 2.1.2
- deno_fetch (crates.io): affected from 0.0.1; fixed in 0.204.0
- deno_fetch (crates.io): affected from 0.0.1; fixed in 0.204.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-21620/ (Markdown: https://insights.sbomify.com/CVE-2025-21620/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-21620
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-21620
- OSV: https://osv.dev/vulnerability/CVE-2025-21620

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-21620/
Summaries are generated and may contain mistakes; the official description above is the record.
