|
| 1 | +[metadata] |
| 2 | +creation_date = "2025/12/04" |
| 3 | +integration = ["network_traffic"] |
| 4 | +maturity = "production" |
| 5 | +updated_date = "2025/12/05" |
| 6 | + |
| 7 | +[rule] |
| 8 | +author = ["Elastic"] |
| 9 | +description = """ |
| 10 | +This rule detects exploitation attempts targeting CVE-2025-55182, a critical remote code execution vulnerability in |
| 11 | +React Server Components (RSC) Flight protocol. The vulnerability allows attackers to execute arbitrary code on the |
| 12 | +server by sending specially crafted deserialization payloads that exploit prototype chain traversal to access the |
| 13 | +Function constructor. This rule focuses on high-fidelity indicators of active exploitation including successful command |
| 14 | +execution responses and prototype pollution attack patterns. |
| 15 | +""" |
| 16 | +from = "now-9m" |
| 17 | +index = ["logs-network_traffic.http*"] |
| 18 | +language = "eql" |
| 19 | +license = "Elastic License v2" |
| 20 | +name = "React2Shell (CVE-2025-55182) Exploitation Attempt" |
| 21 | +note = """## Triage and analysis |
| 22 | +
|
| 23 | +### Investigating React2Shell (CVE-2025-55182) Exploitation Attempt |
| 24 | +
|
| 25 | +This rule detects exploitation attempts targeting CVE-2025-55182, a critical remote code execution vulnerability in React's Flight protocol used by Next.js and other RSC implementations. The vulnerability stems from insecure prototype chain traversal in the Flight deserializer, allowing attackers to access `__proto__`, `constructor`, and ultimately the `Function` constructor to execute arbitrary code. |
| 26 | +
|
| 27 | +### Possible investigation steps |
| 28 | +
|
| 29 | +- Examine the full HTTP request body to identify the specific attack payload and command being executed. |
| 30 | +- Check the response body for `E{"digest":"..."}` patterns which contain command output from successful exploitation. |
| 31 | +- Identify the target application and verify if it runs vulnerable React (< 19.1.0) or Next.js (< 15.3.2) versions. |
| 32 | +- Review the source IP for other reconnaissance or exploitation attempts against web applications. |
| 33 | +- Check for the `Next-Action` header which is required for the exploit to work. |
| 34 | +- Correlate with process execution logs to identify if child processes (e.g., shell commands) were spawned by the Node.js process. |
| 35 | +
|
| 36 | +### False positive analysis |
| 37 | +
|
| 38 | +- Legitimate React Server Components traffic will NOT contain `__proto__`, `constructor:constructor`, or code execution patterns. |
| 39 | +- Security scanning tools like react2shell-scanner may trigger this rule during authorized penetration testing. |
| 40 | +- The combination of prototype pollution patterns with RSC-specific syntax is highly indicative of malicious activity. |
| 41 | +
|
| 42 | +### Response and remediation |
| 43 | +
|
| 44 | +- Immediately update affected applications: React >= 19.1.0, Next.js >= 15.3.2. |
| 45 | +- Block the source IP at the WAF/reverse proxy if exploitation is confirmed. |
| 46 | +- If HTTP 500 or 303 responses with `digest` output were observed, assume successful code execution and investigate for compromise. |
| 47 | +- Review server logs for evidence of command execution (file creation, network connections, process spawning). |
| 48 | +- Implement WAF rules to block requests containing `__proto__` or `constructor:constructor` in POST bodies. |
| 49 | +""" |
| 50 | +references = [ |
| 51 | + "https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182", |
| 52 | + "https://github.com/assetnote/react2shell-scanner", |
| 53 | + "https://slcyber.io/research-center/high-fidelity-detection-mechanism-for-rsc-next-js-rce-cve-2025-55182-cve-2025-66478/", |
| 54 | + "https://github.com/msanft/CVE-2025-55182", |
| 55 | +] |
| 56 | +risk_score = 73 |
| 57 | +rule_id = "a8f7e9d4-3b2c-4d5e-8f1a-6c9b0e2d4a7f" |
| 58 | +severity = "high" |
| 59 | +tags = [ |
| 60 | + "Domain: Network", |
| 61 | + "Domain: Application", |
| 62 | + "Domain: Web", |
| 63 | + "Use Case: Threat Detection", |
| 64 | + "Use Case: Vulnerability", |
| 65 | + "Tactic: Initial Access", |
| 66 | + "Tactic: Execution", |
| 67 | + "Data Source: Network Packet Capture", |
| 68 | + "Resources: Investigation Guide", |
| 69 | +] |
| 70 | +timestamp_override = "event.ingested" |
| 71 | +type = "eql" |
| 72 | + |
| 73 | +query = ''' |
| 74 | +network where http.request.method == "POST" and |
| 75 | +( |
| 76 | + // Successful CVE-2025-55182 RCE - command output in digest |
| 77 | + ( |
| 78 | + http.response.status_code in (500, 303) and |
| 79 | + http.response.body.content like~ "*E{\"digest\"*" and |
| 80 | + http.request.body.content regex~ """.*\$[0-9]+:[a-zA-Z_0-9]+:[a-zA-Z_0-9]+.*""" |
| 81 | + ) or |
| 82 | + // Prototype pollution attempts in RSC Flight data (never legitimate) |
| 83 | + ( |
| 84 | + http.request.body.content regex~ """.*\$[0-9]+:[a-zA-Z_0-9]+:[a-zA-Z_0-9]+.*""" and |
| 85 | + ( |
| 86 | + http.request.body.content like~ "*__proto__*" or |
| 87 | + http.request.body.content like~ "*prototype*" |
| 88 | + ) |
| 89 | + ) |
| 90 | +) |
| 91 | +''' |
| 92 | + |
| 93 | + |
| 94 | +[[rule.threat]] |
| 95 | +framework = "MITRE ATT&CK" |
| 96 | +[[rule.threat.technique]] |
| 97 | +id = "T1190" |
| 98 | +name = "Exploit Public-Facing Application" |
| 99 | +reference = "https://attack.mitre.org/techniques/T1190/" |
| 100 | + |
| 101 | + |
| 102 | +[rule.threat.tactic] |
| 103 | +id = "TA0001" |
| 104 | +name = "Initial Access" |
| 105 | +reference = "https://attack.mitre.org/tactics/TA0001/" |
| 106 | +[[rule.threat]] |
| 107 | +framework = "MITRE ATT&CK" |
| 108 | +[[rule.threat.technique]] |
| 109 | +id = "T1059" |
| 110 | +name = "Command and Scripting Interpreter" |
| 111 | +reference = "https://attack.mitre.org/techniques/T1059/" |
| 112 | +[[rule.threat.technique.subtechnique]] |
| 113 | +id = "T1059.007" |
| 114 | +name = "JavaScript" |
| 115 | +reference = "https://attack.mitre.org/techniques/T1059/007/" |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +[rule.threat.tactic] |
| 120 | +id = "TA0002" |
| 121 | +name = "Execution" |
| 122 | +reference = "https://attack.mitre.org/tactics/TA0002/" |
| 123 | + |
0 commit comments