
Chaîne d'exploitation n8n avant authentification : lecture arbitraire de fichier (CVE-2026-21858) menant à une RCE par injection d'expression (CVE-2025-68613), avec lab Docker, scripts PoC, analyse.
Environnement de pratique (Vulnerable Lab) et rapport détaillé d'analyse et d'exploitation de la chaîne de vulnérabilités Ni8mare sur la plateforme n8n — de l'Arbitrary File Read (CVE-2026-21858) jusqu'à l'Remote Code Execution (CVE-2025-68613), sans authentification.
Veuillez consulter le document d'analyse complet avec les captures PoC illustrant chaque étape dans le rapport officiel :
(Le rapport comprend : analyse de l'architecture n8n, principe de la Content-Type Confusion, Expression Injection sandbox escape, chaîne d'exploitation du file read au RCE, trace de débogage du code source, analyse des causes racines et recommandations de remédiation).
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
Lorsque la bannière « Ni8mare Lab -- READY! » avec la version 1.65.0 apparaît, le lab est prêt. Accédez à n8n à l'adresse http://localhost:5678/.
[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
| Propriété | Détails |
|---|
| CVE ID | CVE-2026-21858 (File Read) + CVE-2025-68613 (RCE) |
| Nom | Ni8mare |
| Type de vulnérabilité | Content-Type Confusion (Arbitrary File Read) + Expression Injection (Sandbox Escape → RCE) |
| Sévérité | Critique — CVSS 10.0 + 9.9 |
| Produits concernés | n8n < 1.121.0 (file read) / 0.211.0 – < 1.120.4 (RCE) |
| Authentification requise | Non requise (chaîne complète pre-auth) |