
POC exploit for CVE-2026-123488 - unauthenticated SQL injection vulnerability in Craft CMS (MySQL/MariaDB backend). Admin takeover.
Unauthenticated SQL injection in Craft CMS element search. Send search as a
PHP array and every key lands in the query builder: search[attribute] ends up
interpolated raw into SQL. MySQL/MariaDB default config allows stacked
statements, so you can read and write the whole database — admin flag included.
Patched sites are not affected.
python poc.py --check-url "http://target/search"
python poc.py --target "http://target/search" --time-based
python poc.py --target "http://target/search" --table users --adminuser admin
--check-url prints the request and exits. --time-based confirms
exploitability with a sleep() oracle. Without it the PoC fires a stacked
UPDATE users SET admin=1 — it writes to the database, so verify the flag
directly afterwards.
Any unauthenticated route that feeds request input into an element query search
works. Search-result templates doing craft.entries().search(param('search'))
are the common case.
--delay if it's slow.search[ bracket-params at the edge if
you can't patch today.The array path of Search::normalizeSearchQuery() merges every key into
default term options, and SearchQuery::_parse() copies them onto each parsed
term as dynamic properties. attribute reaches Search::_sqlWhere(), which
quotes the column name but interpolates the value raw. The 4.18.9 diff fixes
exactly this: an allowlist on term options, quoteValue() on the value, and a
string check on the search parameter.