|
| 1 | +id: 7536c98a-0329-4e0f-901a-fb316748b322 |
| 2 | +name: CVE-2025-55182,CVE-2025-66478 - React2Shell |
| 3 | +function: SCAN_CHECK_ACTIVE_PER_HOST |
| 4 | +location: SCANNER |
| 5 | +source: |- |
| 6 | + /** |
| 7 | + * Active scan check for CVE-2025-55182 (React) and CVE-2025-66478 (Next.js). |
| 8 | + * |
| 9 | + * The vulnerability exploits insecure deserialization in the RSC Flight protocol |
| 10 | + * where unvalidated colon-delimited property references cause server crashes |
| 11 | + * that can lead to RCE (CVSS 10.0). |
| 12 | + * |
| 13 | + * @author Dave Paterson, PortSwigger |
| 14 | + */ |
| 15 | + |
| 16 | + String boundary = "----WebKitFormBoundary" + UUID.randomUUID().toString().replace("-", "").substring(0, 16); |
| 17 | + |
| 18 | + String payload = "--" + boundary + "\r\n" + |
| 19 | + "Content-Disposition: form-data; name=\"1\"\r\n\r\n" + |
| 20 | + "{}\r\n" + |
| 21 | + "--" + boundary + "\r\n" + |
| 22 | + "Content-Disposition: form-data; name=\"0\"\r\n\r\n" + |
| 23 | + "[\"$1:a:a\"]\r\n" + |
| 24 | + "--" + boundary + "--\r\n"; |
| 25 | + |
| 26 | + String request = |
| 27 | + """ |
| 28 | + POST / HTTP/1.1\r |
| 29 | + Host: %s\r |
| 30 | + Content-Type: multipart/form-data; boundary=%s\r |
| 31 | + Next-Action: %s\r |
| 32 | + X-Nextjs-Request-Id: %s\r |
| 33 | + Next-Router-State-Tree: [[["",{"children":["__PAGE__",{}]},null,null,true]]\r |
| 34 | + \r |
| 35 | + """.formatted( |
| 36 | + requestResponse.request().httpService().host(), |
| 37 | + boundary, |
| 38 | + UUID.randomUUID().toString().replace("-", ""), |
| 39 | + UUID.randomUUID().toString() |
| 40 | + ); |
| 41 | + HttpRequestResponse exploitResponse = http.sendRequest(HttpRequest.httpRequest(requestResponse.httpService(), request).withBody(payload)); |
| 42 | + |
| 43 | + if (exploitResponse != null |
| 44 | + && exploitResponse.hasResponse() |
| 45 | + && exploitResponse.response().statusCode() == 500 |
| 46 | + ) |
| 47 | + { |
| 48 | + String body = exploitResponse.response().bodyToString(); |
| 49 | + if (body == null) |
| 50 | + { |
| 51 | + return AuditResult.auditResult(); |
| 52 | + } |
| 53 | + |
| 54 | + if (body.contains("E{\"digest\"") || |
| 55 | + (body.contains("digest") && body.contains("Error"))) |
| 56 | + { |
| 57 | + AuditIssue auditIssue = AuditIssue.auditIssue( |
| 58 | + "CVE-2025-55182 / CVE-2025-66478 React Server Components Remote Code Execution", |
| 59 | + """ |
| 60 | + <p>The application is vulnerable to <b>CVE-2025-55182</b> (React) and <b>CVE-2025-66478</b> (Next.js), \ |
| 61 | + critical Remote Code Execution vulnerabilities in React Server Components with CVSS score of 10.0.</p>\ |
| 62 | + <p><b>Vulnerability Overview:</b></p>\ |
| 63 | + <ul>\ |
| 64 | + <li>Unauthenticated Remote Code Execution via insecure deserialization</li>\ |
| 65 | + <li>The RSC Flight protocol fails to validate property existence in colon-delimited references</li>\ |
| 66 | + <li>Malformed multipart form-data triggers unhandled exceptions leading to RCE</li>\ |
| 67 | + <li>No prerequisites or special configuration required for exploitation</li>\ |
| 68 | + </ul>\ |
| 69 | + <p><b>Detection Evidence:</b></p>\ |
| 70 | + <ul>\ |
| 71 | + <li>✓ HTTP 500 status code received</li>\ |
| 72 | + <li>✓ Next.js error digest pattern detected in response</li>\ |
| 73 | + <li>✓ Server failed to handle malicious property reference: <code>["$1:a:a"]</code></li>\ |
| 74 | + </ul>\ |
| 75 | + """, |
| 76 | + """ |
| 77 | + <p><b>CRITICAL - Immediate Action Required</b></p>\ |
| 78 | + <p>This vulnerability allows unauthenticated attackers to execute arbitrary code on the server. \ |
| 79 | + Patch immediately.</p>\ |
| 80 | + <p><b>Upgrade to Patched Versions:</b></p>\ |
| 81 | + <ul>\ |
| 82 | + <li><b>React:</b> 19.0.1, 19.1.2, or 19.2.1</li>\ |
| 83 | + <li><b>Next.js:</b> 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7, or 16.0.7</li>\ |
| 84 | + </ul>\ |
| 85 | + <p><b>Remediation Steps:</b></p>\ |
| 86 | + <ol>\ |
| 87 | + <li>Update package.json dependencies to patched versions</li>\ |
| 88 | + <li>Run: <code>npm install</code> or <code>npm update</code></li>\ |
| 89 | + <li>Rebuild and redeploy application</li>\ |
| 90 | + <li>Verify fix by re-scanning</li>\ |
| 91 | + </ol>\ |
| 92 | + <p><b>References:</b></p>\ |
| 93 | + <ul>\ |
| 94 | + <li><a href="https://nextjs.org/blog/CVE-2025-66478">Next.js Security Advisory</a></li>\ |
| 95 | + <li><a href="https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182">CVE-2025-55182 Details</a></li>\ |
| 96 | + <li><a href="https://slcyber.io/research-center/high-fidelity-detection-mechanism-for-rsc-next-js-rce-cve-2025-55182-cve-2025-66478/">Detection of CVE-2025-55182</li>\ |
| 97 | + </ul>""", |
| 98 | + requestResponse.request().url(), |
| 99 | + AuditIssueSeverity.HIGH, |
| 100 | + AuditIssueConfidence.CERTAIN, |
| 101 | + null, |
| 102 | + null, |
| 103 | + AuditIssueSeverity.HIGH, |
| 104 | + exploitResponse |
| 105 | + ); |
| 106 | + return AuditResult.auditResult(List.of(auditIssue)); |
| 107 | + } |
| 108 | + } |
| 109 | + |
| 110 | + return AuditResult.auditResult(); |
0 commit comments