# CVE-2025-32421: Next.js Race Condition to Cache Poisoning

> Attackers can poison caches to serve incorrect data due to a race condition in Next.js Pages Router under specific misconfigurations.

- **Severity:** Low 3.7 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/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:** 14 May 2025
- **Updated:** 15 May 2025
- **Also known as:** GHSA-qpjv-v59x-3qc4, MINI-6fmh-4jmf-4pvj, ROOT-APP-NPM-CVE-2025-32421

## What is CVE-2025-32421?

CVE-2025-32421 is a low-severity vulnerability in Vercel Next.js, published on 14 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Next.js is a React framework for building full-stack web applications. Versions prior to 14.2.24 and 15.1.6 have a race-condition vulnerability. This issue only affects the Pages Router under certain misconfigurations, causing normal endpoints to serve `pageProps` data instead of standard HTML. This issue was patched in versions 15.1.6 and 14.2.24 by stripping the `x-now-route-matches` header from incoming requests. Applications hosted on Vercel's platform are not affected by this issue, as the platform does not cache responses based solely on `200 OK` status without explicit `cache-control` headers. Those who self-host Next.js deployments and are unable to upgrade immediately can mitigate this vulnerability by stripping the `x-now-route-matches` header from all incoming requests at the content development network and setting `cache-control: no-store` for all responses under risk. The maintainers of Next.js strongly recommend only caching responses with explicit cache-control headers.

Weakness: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

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

4 open source packages ship an affected version, including next. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `next` | npm | From 0.9.9 | 14.2.24 |
| `next` | npm | From 0.9.9 | 14.2.24 |
| `next` | npm | From 15.0.0 | 15.1.6 |
| `next` | npm | From 15.0.0 | 15.1.6 |

Products: Vercel Next.js.

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

Upgrade next to a fixed version for your release line: 14.2.24 or 15.1.6.

## Is CVE-2025-32421 being exploited?

There is no known exploitation of CVE-2025-32421 in the wild and no public exploit code.

Public exploit code:

- PoC Lab for CVE-2025-32421 – Next.js Race Condition Cache Poisoning Simulation (github_poc): https://github.com/Delfaster/CVE-2025-32421---Race-Condition-Vulnerability---Next.js
- Comprehensive demonstration of CVE-2025-32421 Eclipse technique - a sophisticated race condition attack against Next.js 15.0.4 that bypasses the original CVE-2024-46982 patch. (github_poc): https://github.com/hidesec/CVE-2025-32421

## Other vulnerabilities in Vercel Next.js

- [CVE-2025-29927](https://insights.sbomify.com/CVE-2025-29927/): Authorization Bypass in Next.js Middleware (critical 9.1)
- [CVE-2026-44578](https://insights.sbomify.com/CVE-2026-44578/): Next.js: Server-side request forgery in applications using WebSocket upgrades (high 8.6)
- [CVE-2026-94483](https://insights.sbomify.com/CVE-2026-94483/): Next.js: Server-Side Request Forgery in Image Optimization (high 8.3)
- [CVE-2026-64642](https://insights.sbomify.com/CVE-2026-64642/): Next.js: Middleware / Proxy bypass in App Router applications using Turbopack and single locale (high 8.3)
- [CVE-2026-64645](https://insights.sbomify.com/CVE-2026-64645/): Next.js: Server-Side Request Forgery in rewrites via attacker-controlled destination hostname (high 8.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-32421 is a low-severity vulnerability in Vercel Next.js, published on 14 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-32421 in the wild and no public exploit code.

Affected packages and fixed versions:
- next (npm): affected from 0.9.9; fixed in 14.2.24
- next (npm): affected from 0.9.9; fixed in 14.2.24
- next (npm): affected from 15.0.0; fixed in 15.1.6
- next (npm): affected from 15.0.0; fixed in 15.1.6

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-32421/ (Markdown: https://insights.sbomify.com/CVE-2025-32421/index.md)
```

## Sources

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

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