The Next.js ecosystem — one of the most popular React frameworks powering modern web applications — is facing a major security risk in Dec-2025. Multiple critical vulnerabilities have been disclosed, most importantly a remote code execution (RCE) flaw known as React2Shell, along with related server-side weaknesses that can affect denial of service (DoS), source exposure, and authorization logic. (Next.js)

This blog post breaks down what happened, why it matters, how your applications may be affected, and exact steps you should take today to stay secure.
What’s the Vulnerability?
React2Shell — CVE-2025-55182 (RCE)
React2Shell is a critical vulnerability (CVSS 10.0) in the React Server Components (RSC) Flight protocol, the internal mechanism React and Next.js use to exchange structured data between client and server.
Because Next.js builds on top of React and the App Router uses RSC, this flaw allows unauthenticated attackers to send crafted requests that trigger remote arbitrary code execution on vulnerable servers — effectively full compromise.
Although originally tracked as two separate CVEs (React and Next.js), the Next.js side (CVE-2025-66478) was merged into the React issue because the root cause is shared.
Additional Issues
While React2Shell is the headline, security researchers have also identified related problems including: (Next.js)
- Denial of Service (CVE-2025-55184 & CVE-2025-67779) — specially crafted requests can hang the server loop indefinitely.
- Source Exposure (CVE-2025-55183) — a crafted input can cause server functions to leak compiled code and potentially secrets.
- Older Middleware Auth Bypass (CVE-2025-29927) — an attack path exploiting headers to skip authorization logic in middleware flows.
- Cache Poisoning DoS (CVE-2025-49826) — issues in static/caching behavior that disrupt service. (GitLab Advisory Database)
Who Is Affected?
The most critical RCE affects:
- Next.js 15.x
- Next.js 16.x
- Canary variants (e.g., 14.3.0-canary.77 and later)
only in apps using the App Router / RSC features.
Next.js 13.x (Pages Router only) and pure static sites aren’t directly vulnerable to React2Shell. However, middleware or server functions in older versions may still face other flaws like auth bypass.
How Serious Is This?
This is not an ordinary bug — it has all the worst characteristics:
✔️ No authentication required
✔️ Remote Code Execution possible
✔️ Public exploit proof-of-concept already circulating
✔️ Part of the dependency chain many apps use
Security advisories rate the primary flaw as CVSS 10.0 — Critical. (Cybersecurity Dive)
What You Should Do Today
1. Update Immediately
Ensure you’re running patched versions of both React and Next.js:
✔️ Next.js: update to versions 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7, or 16.0.7+ (these include fixes)
✔️ React: upgrade to React 19.2.1+ or later for RSC fixes. (CyberNewswire)
Immediately run:
npm install next@latest react@latest react-dom@latest
Or use the official Next.js scanning tool:
npx fix-react2shell-next
This helps detect and update vulnerable configurations. (Cyber Security News)
2. Audit External Exposure
If your app exposes Server Functions, API routes, or App Router endpoints, treat them as potentially exploitable until patched.
3. Rotate Secrets After Exposure
If your production environment was exposed in an unpatched state:
- Rotate all API keys and secrets
- Invalidate session tokens
- Reissue database credentials
Because an RCE could allow attackers to read or persist sensitive data.
4. Harden Transport & Deployment
Consider adding network-level protections:
- Use a Web Application Firewall (WAF)
- Proxy sensitive routes behind robust gateways
- Limit publicly exposed server functions
5. Isolate Execution Contexts
If you self-host:
- Run your Next.js app in containers with least privilege
- Avoid running as root
- Employ strict CPU/memory limits so DoS attacks can’t crash the whole host
- Use process managers that auto-restart on failure
This reduces bomb-radius even if exploit attempts occur.
Longer-Term Best Practices
Keep Dependencies Up to Date
Use tools like npm audit, Dependabot, or similar to track vulnerabilities in real time.
Avoid Relying Only on Middleware for Auth
The older CVE-29927 exposed how easy it is to bypass middleware authorization logic. Always enforce security checks at the route handler / API layer too. (Triskele Labs)
Fuzz Test & Security Scan Your Code
Dynamic Application Security Testing (DAST) can uncover hidden input handling bugs that static dependency scanners miss.
Use Runtime Isolation
Run server logic in sandboxes where possible, e.g., serverless environments like Vercel, Cloudflare Workers, etc. These contexts provide additional sandbox barriers that make exploitation harder.
Final Thoughts
The React2Shell incident is a wake-up call for the JavaScript ecosystem: modern abstraction stacks can obscure server-side attack surfaces, and when those surfaces are exposed, the impact is real.
Next.js and React maintainers have responded quickly, but unpatched apps remain at high risk. If you haven’t updated yet, make this a top-priority task — security cannot wait.
Stay secure and stay updated! 💪