Skip to content

// Vulnerability and fix

Insecure deserialization RCE: the React2Shell case

6 minUpdated July 28, 2026By Ler em português

What insecure deserialization is

Serializing turns an object into bytes to transport it; deserializing is the way back. Insecure deserialization is when the server reconstructs an object from data the attacker controls, without validating it, and in that process ends up executing code. It is one of the most severe flaws because it usually gives RCE (remote code execution) directly, with no login needed.

The case that closed 2025 was React2Shell (CVE-2025-55182, CVSS 10.0, and the corresponding CVE-2025-66478 in Next.js): unauthenticated RCE in React Server Components via insecure deserialization. The scary detail is that a default app created with create-next-app and built for production was already exploitable, with no code changes, and there was real in-the-wild exploitation (coin miners) days later.

Why the default app was vulnerable

The point of React2Shell is that the flaw was in the framework, in how React Server Components deserialized input, not in a wrong line by the dev. That is: you could have done everything "right" and still be exposed, just by running the vulnerable version in production. It is the reminder that keeping the framework updated is a security control, not just maintenance hygiene.

How to protect yourself

The defense has two layers: keeping the framework updated (React2Shell’s fix came as a patch, applying it was the first step) and, in your code, never deserializing untrusted data without validating. If you must accept a serialized object, use a pure data format (JSON with a schema) instead of one that reconstructs arbitrary types.

  • Update the framework and runtime; treat a security patch as a priority.
  • Do not deserialize input into arbitrary types; use schema-validated JSON.
  • Run the app with least privilege, to limit what an RCE reaches.
  • Monitor the version against known CVEs (SCA + advisory tracking).

Where RET fits

RET checks whether your stack is on a version vulnerable to a known deserialization/RCE CVE, and reviews where your code deserializes input. More importantly: it maps the blast radius, if an RCE happens, what it reaches (secrets, database, other customers). Risk Review reads those points and the Manual Pentest proves the real reach with evidence.

Want to know whether this happens in your system?

Manual pentest for web applications, APIs and apps, from R$9,500, with the Sprint run within 7 business days. We refund 50% if we find no flaw.

See price and timeline for my case

Frequently asked questions

Does React2Shell affect me if I use Next.js?

If you ran a vulnerable version of React Server Components / Next.js in production, yes, including a default create-next-app app. The fix came as a patch; updating was the urgent step. Apps on fixed versions are no longer affected by that specific CVE.

Is insecure deserialization common in AI-built SaaS?

The most severe case (React2Shell) was in the framework, not the dev’s code. But in your code the risk exists whenever you reconstruct an object from untrusted input. Using schema-validated JSON instead of formats that recreate arbitrary types closes most of it.

Is updating the framework enough?

It closes the specific CVE and is the first step. But the lesson holds going forward: do not deserialize untrusted data in your code, run with least privilege, and monitor the version against advisories. RET reviews that set and the blast radius.

Who runs it at RET?

Gabriel Lima Ferreira, founder and lead pentester, with an authorized scope and reproducible evidence.

Keep reading