CVE-2024-46982
JSON

7.5high

Cache Poisoning in next.js

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
61.0% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-gp8f-8m3g-qvj9

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.

Affected

Product or packageVersionsReported by
vercel next.js>= 13.5.1, < 13.5.7, >= 14.0.0, < 14.2.10, from 13.5.1 before 13.5.7, from 14.0.0 before 14.2.10CVE List, NVD
next (npm)from 13.5.1 before 13.5.7, from 14.0.0 before 14.2.10GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Classification

CWE-349CWE-639

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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:

  • Next.js between 13.5.1 and 14.2.9
  • Using pages router
  • Using non-dynamic server-side rendered routes e.g. pages/dashboard.tsx not pages/blog/[slug].tsx

The below configurations are unaffected:

  • Deployments using only app router
  • Deployments on Vercel are not affected
Patches

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.

Workarounds

There are no official or recommended workarounds for this issue, we recommend that users patch to a safe version.

Credits
  • Allam Rachid (zhero_)
  • Henry Chen
NVD (es)

Next.js es un framework React para crear aplicaciones web full-stack. Al enviar una solicitud HTTP manipulada, es posible envenenar el caché de una ruta renderizada del lado del servidor no dinámica en el enrutador de páginas (esto no afecta al enrutador de aplicaciones). Cuando se envía esta solicitud manipulada, podría obligar a Next.js a almacenar en caché una ruta que no debe almacenarse en caché y enviar un encabezado `Cache-Control: s-maxage=1, stale-while-revalidate` que algunas CDN ascendentes también pueden almacenar en caché. Para verse potencialmente afectado, se deben aplicar todas las siguientes condiciones: 1. Next.js entre 13.5.1 y 14.2.9, 2. Usar el enrutador de páginas y 3. Usar rutas renderizadas del lado del servidor no dinámicas, por ejemplo, `pages/dashboard.tsx` no `pages/blog/[slug].tsx`. Esta vulnerabilidad se resolvió en Next.js v13.5.7, v14.2.10 y posteriores. Recomendamos actualizar independientemente de si se puede reproducir el problema o no. No existen workarounds oficiales ni recomendadas para este problema, recomendamos que los usuarios instalen el parche a una versión segura.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-46982 changed 2024-09-18CVE Terms of Use
GitHub Advisory DatabaseGHSA-gp8f-8m3g-qvj9 changed 2026-09-10CC-BY-4.0
NVDCVE-2024-46982 changed 2026-06-17Public domain