zlacker

[return to "RCE Vulnerability in React and Next.js"]
1. coffee+ny[view] [source] 2025-12-03 18:34:31
>>rayhaa+(OP)
This vulnerability is basically the worst-case version of what people have been warning about since RSC/server actions were introduced.

The server was deserializing untrusted input from the client directly into module+export name lookups, and then invoking whatever the client asked for (without verifying that metadata.name was an own property).

    return moduleExports[metadata.name]

We can patch hasOwnProperty and tighten the deserializer, but there is deeper issue. React never really acknowledged that it was building an RPC layer. If you look at actual RPC frameworks like gPRC or even old school SOAP, they all start with schemas, explicit service definitions and a bunch of tooling to prevent boundary confusion. React went the opposite way: the API surface is whatever your bundler can see, and the endpoint is whatever the client asks for.

My guess is this won't be the last time we see security fallout from that design choice. Not because React is sloppy, but because it’s trying to solve a problem category that traditionally requires explicitness, not magic.

◧◩
2. j45+oC[view] [source] 2025-12-03 18:53:13
>>coffee+ny
For the layperson, does this mean this approach and everything that doesn't use it is not secure?

Building a private, out of date repo doesn't seem great either.

◧◩◪
3. coffee+uD[view] [source] 2025-12-03 18:58:36
>>j45+oC
Not quite. This isn’t saying React or Next.js are fundamentally insecure in general.

The problem is this specific "call whatever server code the client asks" pattern. Traditional APIs with defined endpoints don’t have that issue.

◧◩◪◨
4. koakum+H41[view] [source] 2025-12-03 21:10:06
>>coffee+uD
You mean call whatever server action the client asks? I don't think having this vulnerability was intentional.
◧◩◪◨⬒
5. j45+2q1[view] [source] 2025-12-03 22:59:23
>>koakum+H41
I don’t think I’ve heard of intentional vulnerabilities?
◧◩◪◨⬒⬓
6. morshu+uy1[view] [source] 2025-12-03 23:59:05
>>j45+2q1
Log4j almost seemed like it
◧◩◪◨⬒⬓⬔
7. j45+px3[view] [source] 2025-12-04 16:44:04
>>morshu+uy1
Seems subjective and a personal interpretation.
[go to top]