Next.js Cache Poisoning (CVE-2025-49826): DoS Risk and Fix

CVE-2025-49826 is a cache poisoning flaw in the Next.js React framework that could cause denial of service. Under certain conditions, an HTTP 204 (No Content) response could be cached for a static page, so later visitors received an empty response instead of the page. It affects self-hosted Next.js 15 versions before 15.1.8 and is rated High (CVSS 7.5) for availability impact only; no data is exposed.

Jul 07, 2025 - 09:33
Updated: 
104.9k

Cyber Threats, Scams & Online Safety in Cybersecurity & Ethical Hacking · News & analysis

Next.js Cache Poisoning (CVE-2025-49826): DoS Risk and Fix

Quick answer: CVE-2025-49826 is a cache poisoning flaw in the Next.js React framework that could cause denial of service. Under certain conditions, an HTTP 204 (No Content) response could be cached for a static page, so later visitors received an empty response instead of the page. It affects self-hosted Next.js 15 versions before 15.1.8 and is rated High (CVSS 7.5) for availability impact only; no data is exposed. Apps hosted on Vercel were not affected. Upgrade to Next.js 15.1.8 or later, redeploy, and clear any CDN or reverse proxy caches.

Key takeaways

  • Fixed in Next.js 15.1.8; upgrade self-hosted apps.
  • Impact is availability: pages served empty, not data theft.
  • Vercel says its hosted platform was not affected.
  • Purge caches after upgrading so poisoned entries disappear.
  • Review caching rules so error and empty responses are not cached.

Table of Contents

What Is CVE-2025-49826?

The Next.js security advisory explains that, under certain conditions, a 204 response could be cached for static pages. A 204 status means "no content" (RFC 9110), so every user served from the poisoned cache got a blank response until the cache expired. The NVD entry rates it CVSS 7.5 with availability as the only impact.

What Is Cache Poisoning?

Web caches store responses to serve future requests quickly. Cache poisoning happens when an attacker or an unusual condition causes the cache to store a harmful or wrong response, which is then served to everyone. OWASP describes the general attack class, which can range from denial of service to serving malicious content.

Who Is Affected?

DeploymentStatus
Self-hosted Next.js 15 before 15.1.8Affected (advisory range starts at 15.0.4-canary.51)
Next.js 15.1.8 and laterFixed
Apps hosted on VercelNot affected, per Vercel

How Do You Fix It?

# Check the installed version
npm ls next

# Upgrade to a fixed release (or the latest 15.x)
npm install next@^15.1.8

# Rebuild and redeploy
npm run build

After deploying, purge your CDN or reverse proxy cache so no poisoned entries remain. The fix is in the v15.1.8 release.

How Do You Harden Caching in Web Apps?

  • Never cache error responses or empty responses for public pages.
  • Set explicit Cache-Control headers per route.
  • Include only intended headers in the cache key; ignore untrusted headers.
  • Monitor for sudden spikes in empty or error responses.
  • Keep frameworks updated with automated dependency alerts.

Related: continuous security testing in DevSecOps and Node.js vulnerabilities. WebAsha offers web application security training.

How Should Teams Track Framework Vulnerabilities?

  • Enable dependency alerts in your code host and review them weekly.
  • Run npm audit or an SCA tool in CI and fail builds on critical issues.
  • Subscribe to framework security advisories and release notes.
  • Keep a software bill of materials for deployed apps.
  • Patch promptly and redeploy, then purge caches where relevant.
# List known vulnerabilities in installed npm packages
npm audit --omit=dev

NIST SP 800-218 (SSDF) describes responding to vulnerabilities as part of secure development, and CISA promotes SBOMs for tracking components.

References

Frequently Asked Questions

A Next.js flaw where a 204 No Content response could be cached for static pages, causing denial of service.

Next.js 15.1.8 contains the fix, so upgrade self-hosted apps to 15.1.8 or a later release.

No. Vercel stated that applications hosted on its platform were not affected by this vulnerability.

No. The impact is availability only, with users receiving empty pages instead of content.

Getting a cache to store a wrong or harmful response that is then served to many users.

Rebuild, redeploy and purge CDN or reverse proxy caches so no poisoned entries remain.

It is rated High with a CVSS score of 7.5, reflecting high availability impact without data exposure.

Do not cache errors or empty responses, set explicit Cache-Control headers and restrict what goes into cache keys.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.