漏洞实验室(Vulnerable Lab)环境与 n8n 平台上 Ni8mare 漏洞链的详细利用分析报告——从 任意文件读取(CVE-2026-21858)到 远程代码执行(CVE-2025-68613),全程无需认证。
请参阅官方报告,查看包含逐步 PoC 演示截图的完整分析文档:
(报告内容包括:n8n 架构分析、Content-Type Confusion 原理、Expression Injection 沙箱逃逸、从文件读取到 RCE 的利用链、源码调试追踪、根因分析及修复建议)。
| 属性 | 详情 |
|---|
| CVE ID | CVE-2026-21858(文件读取)+ CVE-2025-68613(RCE) |
| 名称 | Ni8mare |
| 漏洞类型 | Content-Type Confusion(任意文件读取)+ Expression Injection(沙箱逃逸 → RCE) |
| 严重程度 | Critical — CVSS 10.0 + 9.9 |
| 受影响产品 | n8n < 1.121.0(文件读取)/ 0.211.0 – < 1.120.4(RCE) |
| 认证要求 | 无需认证(pre-auth 完整链路) |
Content-Type Confusion Forge Admin JWT Expression Injection
(CVE-2026-21858) (CVE-2025-68613)
POST application/json --> Đọc config + DB --> Tạo workflow với
filepath: /etc/passwd Tính jwt_secret malicious expression
Ký admin token this.process.mainModule
.require("child_process")
Arbitrary File Read --> Auth Bypass --> Remote Code Execution
(CVSS 10.0) (CVSS 9.9)
cd ni8mare-lab
docker compose up -d --build
docker compose logs -f
当看到 “Ni8mare Lab -- READY!” 横幅并显示版本号 1.65.0 时,表示实验室已就绪。通过 http://localhost:5678/ 访问 n8n。
[email protected] / ExploitLab123!docker compose down -v
├── REPORT.md # Báo cáo phân tích kỹ thuật & PoC chi tiết
├── ni8mare-lab/ # Môi trường Docker lab
│ ├── docker-compose.yml # Cấu hình Docker n8n 1.65.0
│ ├── Dockerfile # Custom image với setup script
│ └── init/setup.sh # Script tạo admin + workflow vulnerable
├── ni8mare_exploit.py # Exploit script — target Docker Linux (lab)
├── ni8mare_exploit_2.py # Exploit script — target Windows (n8n build từ source, dùng để debug)
└── img/ # Hình ảnh minh chứng PoC
├── setup-*.png # Screenshots thiết lập lab
├── condition-*.png # Screenshots điều kiện khai thác
├── recon-*.png # Screenshots reconnaissance
├── exploit-*.png # Screenshots exploitation
└── debug-*.png # Screenshots debug source code