A deep technical analysis of CVE-2025-55182, dubbed "React2Shell" - the first CVSS 10.0 vulnerability in React's history. How it works, why it's dangerous, and how to protect your applications.
npm update react react-dom# Verify version is 19.2.4 or highernpm list react
If you cannot update immediately, disable React Server Components or implement the WAF rules described below.
React2Shell exploits a prototype pollution vulnerability in React Server Components' serialization layer. When a malicious payload is passed through specific component props, it can escape the serialization sandbox and execute arbitrary code on the server.
// WARNING: For educational purposes only
// This payload has been sanitized
const maliciousProps = {
__proto__: {
// Pollutes Object.prototype
polluted: true
},
constructor: {
prototype: {
// Triggers during JSON operations
toJSON: () => {
// RCE payload would execute here
return "pwned";
}
}
}
};
// When passed to a Server Component:
// <VulnerableComponent data={maliciousProps} />
// Server executes attacker code
The maximum CVSS score reflects the severity across all metrics:
Exploitable remotely without authentication
No special conditions or race conditions required
Unauthenticated attackers can exploit
Full server compromise possible
| Framework | Affected Versions | Patched Version |
|---|---|---|
| React | 18.0.0 - 19.2.3 | 19.2.4 |
| Next.js | 13.0.0 - 15.0.3 | 15.0.4 |
| Remix | 2.0.0 - 2.14.2 | 2.14.3 |
| Gatsby | Not affected* | N/A |
*Gatsby uses client-side rendering only and is not affected by this RSC vulnerability.
# Block requests containing prototype pollution patterns
SecRule REQUEST_BODY "@rx (__proto__|constructor\.prototype)" \
"id:100001,phase:2,deny,status:403,\
msg:'React2Shell CVE-2025-55182 Attempt'"
# Block in query strings
SecRule ARGS "@rx (__proto__|constructor\.prototype)" \
"id:100002,phase:2,deny,status:403,\
msg:'React2Shell Query Parameter Attack'"
Tech Entrepreneur & Innovator