ZeroHour

CVE-2024-46982

mass

Cache poisoning in Vercel Next.js pages-router server-rendered routes

CVSS 3.1
7.5 high
EPSS
59%p99
Published
()
Modified
AI analysis

CVE-2024-46982 is a cache-poisoning flaw in Next.js, Vercel's React full-stack web framework, in which a crafted HTTP request makes Next.js cache a non-dynamic, server-side rendered route in the pages router that was intended not to be cached (the app router is not affected). By sending such a crafted request, an unauthenticated attacker can coerce Next.js to treat a normally uncached route as cacheable and emit a `Cache-Control: s-maxage=1, stale-while-revalidate` header that some upstream CDNs and shared caches honor, so unintended cached responses can be served to subsequent visitors; the CVSS 3.1 score of 7.5 rates the impact as high for availability. A deployment is potentially affected only if all three conditions hold: Next.js between 13.5.1 and 14.2.9, use of the pages router, and at least one non-dynamic SSR route such as `pages/dashboard.tsx` (not dynamic routes like `pages/blog/[slug].tsx`). The flaw is fixed in Next.js 13.5.7 and 14.2.10 and later, and there are no officially recommended workarounds, so patching is the primary remediation. No exploitation is currently confirmed - it is not in CISA KEV and no public proof-of-concept is known - but EPSS assigns a 59.2% probability of exploitation within 30 days (99th percentile), so exposure is expected to grow.

What to do: Upgrade to Next.js 13.5.7 or 14.2.10 (or later); no workarounds are officially recommended, so patching is the primary remediation, and Vercel advises upgrading even if you cannot reproduce the issue. Audit your deployment for the three conditions: pages router usage, Next.js 13.5.1-14.2.9, and non-dynamic SSR routes (e.g., pages/dashboard.tsx), and check whether responses from such routes are cached by an upstream CDN honoring s-maxage/stale-while-revalidate.

Affected
Vercel Next.js13.5.1 through 14.2.9 inclusive, when using the pages router with non-dynamic SSR routes; fixed in 13.5.7, 14.2.10, and later
Estimated exposure
masson the order of hundreds of thousands of deployments (Next.js drew millions of weekly npm downloads during the affected 13.5.1-14.2.9 window); exact count… — Next.js was among the most widely deployed React frameworks throughout 2024 with millions of weekly npm downloads and the 13.5.x-14.2.x range dominant in production, and the pages router remained the default for existing apps; the…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

Next.js is a React framework for building full-stack web applications. By sending a crafted HTTP request, it is possible to poison the cache of a non-dynamic server-side rendered route in the pages router (this does not affect the app router). When this crafted request is sent it could coerce Next.js to cache a route that is meant to not be cached and send a `Cache-Control: s-maxage=1, stale-while-revalidate` header which some upstream CDNs may cache as well. To be potentially affected all of the following must apply: 1. Next.js between 13.5.1 and 14.2.9, 2. Using pages router, & 3. Using non-dynamic server-side rendered routes e.g. `pages/dashboard.tsx` not `pages/blog/[slug].tsx`. This vulnerability was resolved in Next.js v13.5.7, v14.2.10, and later. We recommend upgrading regardless of whether you can reproduce the issue or not. There are no official or recommended workarounds for this issue, we recommend that users patch to a safe version.

Vendors
vercel
Products
next.js
Weakness
CWE-639
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

In the news

No ingested article mentions this CVE yet.