All posts
reactsecurity

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.

Muhamad Choirul Adam 3 min readPhoto: Unsplash

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

Rendering diagram…

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

  1. Check what's actually deployed. Not what package.json says, what the lockfile resolved. bun pm ls react-server-dom-webpack or the equivalent for each app.
  2. 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).
  3. Deploy, then verify the running build reports the new version.
  4. 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 placeWhy it helped
Committed lockfilesI knew exactly which version each app was running
One-command deploysPatching four apps didn't need a release meeting
A cooldown on new versions with an overrideSecurity upgrades went in on purpose, right away
Access checks next to the dataDefense 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.