react2shell Cve 2025 55182 Explained For Mere Mortals
React's Flight protocol deserialisation failed to restrict access to built-in object properties, allowing an attacker to reach the Function constructor and execute arbitrary code on the server. The author demonstrates a reliable remote code execution chain by abusing thenables and raw chunk references.
Published on infosecwriteups.com
Free Link
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
Impact
An attacker could achieve reliable remote code execution on the server.
What the attacker needed
Ability to send crafted Flight protocol data
How it was found
- Create a chunk that references another chunk's __proto__:constructor:constructor to obtain the Function constructor.
- Set a then property on an object to that constructor so that awaiting the thenable calls it.
- Use the $@ syntax to reference the raw chunk, whose prototype has a then method that calls initializeModelChunk when status is resolved_model.
- Set the value to $B0 to enter the blob handling branch that calls response._formData.get(response._prefix + obj).
- Set _response._formData.get to the Function constructor and put the desired code in _response._prefix, using // to comment out the rest.
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 uses a special data format to send objects between the browser and the server. The server did not block special property names like __proto__, which let an attacker reach JavaScript's built-in Function constructor and run their own code on the server. This means an attacker could take full control of 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.