
PoC for CVE-2026-123488: unauthenticated SQLi in the element search endpoint (CWE-89) escalating to admin via stacked UPDATE;
A/B Docker lab (vulnerable 4.18.8 vs patched 4.18.9 control) plus a
lab-validated PoC for the unauthenticated SQL injection in the Craft CMS
element search endpoint. The PoC escalates to administrator by stacking an
UPDATE users SET admin=1 — unauthenticated, no CVE-unassigned guessing,
verified causally against the A/B pair.
| CVE | CVE-2026-123488 (GHSA-qcvp-ggx3-97r6) |
| Product | Craft CMS (craftcms/cms) 4.0.0 – 4.18.8, 5.0.0 – 5.11.1 |
| Fixed | 4.18.9 / 5.11.2 (2026-09-17; CVE assigned 2026-11-06, ~50-day gap) |
| CWE | CWE-89, CVSS 3.1 9.8 (AV:N/AC:L/PR:N/UI:N), CVSS 4.0 9.3 |
| Requires | MySQL/MariaDB backend (PDO ATTR_EMULATE_PREPARES=1, the default) |
A search parameter sent as a PHP array reaches
Search::normalizeSearchQuery(), which merges every attacker-supplied key
into SearchQuery default term options and stamps them onto each parsed term.
The attribute key flows into Search::_sqlWhere(), which quotes the column
name but interpolates the value raw. With emulated prepares, stacked
statements execute — arbitrary read/write, including the admin flag on
users. The 4.18.9 fix adds an allowlist
(ALLOWED_DEFAULT_TERM_OPTIONS = ['subLeft','subRight','exclude','exact'])
and value quoting.
Any public template that passes request input into an element query search
works as a sink, e.g. craft.entries().search(param('search')). This repo's
lab ships one (templates/search.html).
docker compose up -d # builds two Craft installs + MySQL 8
# wait ~2 min for both installs (watch: docker compose logs -f craft-vuln)
vulnerable: http://localhost:18080 (Craft 4.18.8)
patched: http://localhost:18081 (Craft 4.18.9, negative control)
CP: /index.php?p=admin (admin / adminadmin)
Both installs share one MySQL container (separate DBs craft_vuln /
craft_patched); both expose the same search sink so the A/B comparison is
like-for-like.
# dry run — prints the request, sends nothing (safe default)
python3 poc.py --check-url "http://localhost:18080/index.php?p=search"
# detection only — time-based sleep() oracle, no write
python3 poc.py --detect --target "http://localhost:18080/index.php?p=search" --delay 3
# exploit — detection, then stacked UPDATE users SET admin=1 (writes!)
python3 poc.py --exploit --target "http://localhost:18080/index.php?p=search" --delay 3
Delay scales with the rows scanned by the outer query (the sleep runs per
row): a 3s sleep measured 18s on the lab's populated sink, so drop --delay
on larger sites.
./validate-lab.sh runs the full A/B battery and prints the verdict table:
admin=0 on both databases (causal baseline),ATTR_EMULATE_PREPARES prerequisite.Measured on this lab (6 candidate rows through the sink):
| Check | 4.18.8 (vulnerable) | 4.18.9 (control) |
|---|---|---|
| Detection (sleep 3) | 18.0s | 0.0s |
| Detection (sleep 5) | 30.0s | 0.0s |
Stacked UPDATE → users.admin | 0 → 1 | 0 (unchanged, HTTP 200 in 0.015s) |
The only actor between baseline=0 and the verified=1 was the unauthenticated PoC request; the patched control rejected the stacked statement.
docker-compose.yml vulnerable 4.18.8 + patched 4.18.9 + MySQL 8
poc.py detection + stacked-UPDATE privesc (dry-run default)
validate-lab.sh A/B validation battery (resets baseline, prints verdict)
craft/Dockerfile PHP 8.2 + exact craftcms/cms pin (no dev deps)
craft/install.sh unattended Craft install + sink template
craft/templates/search.html sink: craft.users().search(request param)
craft/web/, craft/routes.php minimal project bootstrap (scaffold 4.8.0 files)
init.sql two databases, one per Craft side
fixedbyreboot/CVE-2026-123488-POC
(published 2026-11-06). This repo is an independent lab + re-implementation
used to validate the claim A/B; payloads follow the documented injection
pattern.SearchQuery.php, Search.php,
Element.php, StringHelper.php, Elements.php)Lab credentials are throwaway (admin/adminadmin, local-only MySQL).
poc.py sends nothing unless you pass --target, and writes nothing unless
you pass --exploit (--detect is timing-only). The stacked statement
flips one flag. Do not run it against systems you do not own or are not
authorized to test. Patch: upgrade to ≥ 4.18.9 / ≥ 5.11.2.
MIT — see LICENSE.