Skip to content
RCE Write-up Advanced

React2Shell Explained: The New Vulnerability Breaking Websites Wo

A deserialisation flaw in React Server Components lets attacker-controlled input reach the React Flight protocol, where a crafted fake Chunk object is treated as a Promise and its then method is invoked. The article claims this chain escalates to arbitrary code execution under the Node.js runtime.

Motasem Hamdan Follow

Published on motasemhamdan.medium.com

React2Shell represents one of the most significant shifts in web exploitation in recent years not because it abuses memory corruption, but because it weaponizes UI logic, turning modern frameworks into direct vectors for backend compromise. This vulnerability class impacts React Server Components (RSC) , a feature…

Motasem Hamdan, on motasemhamdan.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the React Flight deserialisation logic trusts attacker-supplied object structures, so a forged Chunk with a then property is treated as a Promise and its method is invoked with the attacker's object as context.

Impact

The article claims the chain can escalate to arbitrary code execution under the Node.js runtime, though it gives no working end-to-end demonstration in the visible text.

What the attacker needed

React 19 with Server Components; Attacker input reaches the Flight protocol; A deployment exposing server actions externally

How it was found

  1. Send a multipart form request containing a crafted fake Chunk object.
  2. Set the then property on that object to reference Chunk.prototype.then.
  3. React processes the object and treats it like a Promise.
  4. React automatically calls the then method, with the malicious object as the this context.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

React Server Components let a website build parts of its pages on the server rather than in the visitor's browser. The server and browser exchange data in a special format called React Flight, and the article says that format was only meant for internal use. If a site lets outside input reach that format, an attacker may be able to shape the data so the server runs code of their choosing.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Motasem Hamdan

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.