Skip to content
RCE Write-up Advanced

How a React Request Turned Into Full Server Shell Root Access (Re

Unsafe object reconstruction in React and Next.js server-side deserialisation lets an attacker turn a crafted request into arbitrary JavaScript execution and then OS command execution. The text claims this gives full server shell access on unpatched self-hosted deployments.

Muhammad Abdul Rehman Follow

Published on medium.com

As we know, React is no longer “just frontend”. With Next.js Server Actions and React Server Components, React now runs directly on the server, and that shift introduces a new class of vulnerabilities known as React-to-Shell.

Muhammad Abdul Rehman, 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 unsafe deserialisation and object reconstruction in the React/Next.js server runtime, where attacker-controlled input can reach prototype and constructor chains and end in code execution.

Impact

On unpatched self-hosted or non-Vercel deployments, an attacker could read secrets, run system commands, install backdoors and move laterally; Vercel's platform protections and patched releases block this.

What the attacker needed

Unpatched React/Next.js; self-hosted or non-Vercel deployment; attacker can send a request

The fix

Upgrade React and Next.js to patched releases, avoid exposing Server Actions publicly, never trust serialised RSC input and run apps with least privilege.

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 and Next.js can now run code on the server, not just in the browser. If the server rebuilds objects from data sent by a user without checking it properly, an attacker can sneak in a special object that makes the server run their own code. That code can then run operating system commands, which is why the text calls it a shell.

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 Muhammad Abdul Rehman

View all

1 more disclosed report, 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.