惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
WordPress大学
WordPress大学
D
DataBreaches.Net
腾讯CDC
小众软件
小众软件
B
Blog RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Y
Y Combinator Blog
V
V2EX
I
InfoQ
D
Docker
量子位
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
A
About on SuperTechFans
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
阮一峰的网络日志
阮一峰的网络日志
MyScale Blog
MyScale Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
CVE-2025-55182 · React2Shell: RCE in React Server Compone...
Annais Molin · 2026-05-03 · via DEV Community

This is a summary. The full analysis — root cause walkthrough, complete payload, exploitation framework, forensic artifacts, and patch diffing — lives at blog.deviannt.com.

TL;DR: React's Flight deserializer evaluates any object with a .then method as a Promise, regardless of its actual type. An attacker poisons Object.prototype.then through a crafted multipart POST, forcing the server to execute arbitrary JavaScript via the Function constructor. The result is exfiltrated through the X-Action-Redirect HTTP header. No authentication required. Deterministic. CVSS v3.1: 10.0 (Critical).

The attack surface

React Server Components (RSC) stabilized in React 19 alongside Server Actions — a model where UI components execute directly on the server and communicate with the client through a custom serialization layer called the Flight protocol. When a client invokes a Server Action, it sends a multipart POST with a serialized payload. The server deserializes it, executes the action, and streams the result back.

The Flight protocol is not JSON. It is a streaming format with typed chunks. Its core mechanism: if a deserialized object has a .then function, the runtime resolves it as a Promise.

That assumption is the root of this vulnerability.

⚠️ Any Next.js application using the App Router with React Server Components is affected — the default since Next.js 14. Explicitly defined Server Actions are not required. The presence of the affected RSC packages is sufficient

Root cause

// VULNERABLE — React 19.0.0 / 19.1.0 / 19.1.1 / 19.2.0
if (obj && typeof obj.then === 'function') {
  // behavioral check — bypassable via prototype chain
}

Enter fullscreen mode Exit fullscreen mode

If an attacker writes a function to Object.prototype.then, every plain object in the runtime inherits it. The deserializer can no longer distinguish a real Promise from a poisoned plain object — and calls new Function(_prefix) on attacker-controlled content.

The exploit chain

  1. Reconnaissance — identify a Next.js app running React 19.0.0–19.2.0 with App Router. Any endpoint processing multipart/form-data with a Next-Action header is a valid target. No specific route or prior knowledge of the app structure needed.
  2. Payload construction — multipart body where __proto__:then poisons Object.prototype, _formData.get is redirected to $1:constructor:constructor, and _prefix carries the JavaScript to execute.
  3. Request delivery — single POST to root with Next-Action: x. WAFs see a well-formed multipart request and forward without inspection. No standard injection signatures triggered.
  4. Server-side evaluation — the Flight deserializer encounters an object with .then (inherited from the poisoned prototype). Calls new Function(_prefix). Executes attacker code.
  5. ExfiltrationexecSync() output is interpolated into a NEXT_REDIRECT error digest. Next.js converts it into a 307 with X-Action-Redirect: /login?a=<output>. Decode the parameter.

No shell injection. No file upload. No authentication. One POST request.

Basic RCE: whoami, id and uname -a executed on the vulnerable Node.js server. Basic RCE: whoami, id and uname -a executed on the vulnerable Node.js server.

The complete payload structure, the minimal curl one-liner, and the full exploitation framework react2shell.py — with modules for persistent interactive shell, environment variable exfiltration, defacement, and selective denial of service — are documented at blog.deviannt.com.

The patch

Released simultaneously across three React 19 branches: 19.0.1, 19.1.2, 19.2.1 (December 3, 2025).

// VULNERABLE
- resolvedValue = resolvedValue[key];

// PATCHED
+ if (!resolvedValue.hasOwnProperty(key)) break;
+ resolvedValue = resolvedValue[key];

Enter fullscreen mode Exit fullscreen mode

hasOwnProperty guards prevent prototype chain traversal. The attacker can no longer reach the Function constructor through $1:constructor:constructor. Chain broken at the first link.

Verify your installation:

node -e "const r = require('react'); const [maj,min,pat] = r.version.split('.').map(Number); \
  console.log('React:', r.version, (maj===19 && (min<2||(min===2&&pat<1))) ? '❌ VULNERABLE' : '✓ Patched')"

Enter fullscreen mode Exit fullscreen mode

🔴 Post-patch advisory: The initial patch versions (19.0.1, 19.1.2, 19.2.1) also contain two follow-on CVEs: CVE-2025-55184 (DoS, CVSS 7.5) and CVE-2025-55183 (Source Code Exposure, CVSS 5.3). Update to 19.0.2, 19.1.3, or 19.2.2.

One structural lesson

Behavioral trust is weaker than identity trust. The typeof obj.then === 'function' check was designed to be flexible and work with any thenable. That flexibility is exactly what made it exploitable. When a security boundary depends on an object's behavior rather than its identity, prototype pollution becomes a master key.


Full analysis → blog.deviannt.com · CVE-2025-55182 · React2Shell
— devianntsec // security research & beyond