Skip to content
RCE Write-up Advanced

React2shell

The article describes a vulnerability in React Server Components where the server resolves client-supplied reference strings by walking object properties without checking ownership, allowing an attacker to traverse into the prototype chain and reach the Function constructor. This could lead to remote code execution on the server.

medium.com

Published on medium.com

Understanding Object Traversal, Flight Payloads, and Prototype Exploits in React Server Components

Anandhu Kannan, on 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 server walks client-supplied property paths using direct bracket access without verifying that each property belongs to the intended object, so the path can reach the prototype chain and the Function constructor.

Impact

An attacker could escape the intended object, reach Node internals, and execute system commands on the server.

What the attacker needed

Ability to send a crafted Flight payload

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 the server send a compact description of data to the browser instead of the full data. The browser can send back short reference strings that tell the server which part of its stored data to look at. This article explains that if the server follows those references without checking whether each step is a legitimate property, an attacker can craft a reference that walks into JavaScript's built-in objects and eventually runs their own code on the server.

What is RCE?

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

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.