React2Shell: Patching a Server Components RCE in a Week of Follow-Ups
A maximum-severity bug in how React Server Components decode requests meant one crafted request could run code on the server. The patch was quick. Then came the second patch, and the third.
On December 3, the React team disclosed CVE-2025-55182, quickly nicknamed React2Shell. It scored the maximum 10.0. The bug was in how React Server Components decode the payloads sent to Server Function endpoints: a crafted request could get the server to run code. No login needed, and an app could be exposed even if it never defined a Server Function itself.
It affected the react-server-dom-* packages in React 19.0, 19.1, and 19.2, which means every Next.js App Router app on 15 or 16.
The week, in order
The first patches went out with the disclosure. Then researchers started looking hard at Server Components, and more came out: the original fix was incomplete, and two related bugs, a denial of service and a source-code exposure, got their own CVEs. Each one meant another upgrade.
What I did for each app
- Check what's actually deployed. Not what
package.jsonsays, what the lockfile resolved.bun pm ls react-server-dom-webpackor the equivalent for each app. - Upgrade React and Next.js together to the patched releases listed in the official advisories, not to a version number from a blog post (including this one).
- Deploy, then verify the running build reports the new version.
- Repeat when the next advisory landed.
Steps 1 to 3 took minutes per app. Step 4 is the one that mattered: by the end of the week, anyone who patched once and moved on was still exposed.
What made it fast
| Already in place | Why it helped |
|---|---|
| Committed lockfiles | I knew exactly which version each app was running |
| One-command deploys | Patching four apps didn't need a release meeting |
| A cooldown on new versions with an override | Security upgrades went in on purpose, right away |
| Access checks next to the data | Defense in depth, even if this bug went around them |
The cooldown is worth a note. It's there to keep brand-new versions out, which is exactly what you don't want for a critical fix. Having a known, quick way to override it for one package made this a non-event.
Why it matters
The new idea in Server Components is that the client can call functions on the server through a protocol the framework owns. That protocol is now attack surface I don't write and can't fully review. I can't prevent a bug like this. What I can do is be the kind of team that ships the fix the same day, and the next one, and the one after that.
Keep reading
All posts2025
3 min
Next.js 16 Cache Components: Caching You Opt Into, One Function at a Time
Next.js 15 stopped caching by default. Next.js 16 gave the opt-in a real shape, `use cache` on the functions and components that deserve it, and Suspense around everything else.
nextjsreact3 min
React Compiler 1.0 and the useMemo I Got to Delete
The compiler memoizes for you at build time. What to remove, what to keep, and the rule it quietly enforces.
reactfrontend