/

CVE-2026-123489

Severity:

HIGH RISK

(7.1)

Blind SQL Injection (CWE-89) in Craft CMS Navigation

CVE-2026-123489

Awaiting Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Conditional database inference and potential unauthorized access to data available to the Craft database account

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Craft CMS contains a blind SQL injection flaw in sandbox-exposed navigation methods that accept element criteria. An authenticated control panel user may be able to use crafted criteria in a rendered template to infer database information through conditional query behavior.

Affected context

The issue affects Craft CMS 4.0.0 before 4.18.9 and 5.0.0 before 5.11.2. It occurs when sandbox-exposed getNext() or getPrev() methods pass criteria arrays to Craft::configure() without removing SQL-bearing properties such as orderBy and where.

Exploit preconditions

  • Attack surface: Craft CMS control panel functionality involving sandboxed templates and element navigation
  • Required access: An authenticated control panel account able to supply relevant input
  • Trigger point: A crafted elementIds value is processed by a rendered template that invokes getNext() or getPrev()
  • Why exploitation is possible: SQL-bearing criteria can reach database query construction, potentially exposing a conditional SQL oracle under the Craft database account

Why this happens

The underlying flaw is improper neutralization of special elements in SQL commands, mapping to CWE-89: SQL Injection. The navigation methods accept arbitrary criteria and pass them into configuration without excluding properties that can influence SQL generation. As a result, attacker-controlled values may affect database query behavior rather than being limited to safe, validated criteria.

Potential impact

  • An attacker could infer information from database responses through conditional behavior.
  • Database contents available to the Craft database account may be exposed, depending on query access and deployment controls.
  • Sensitive application or user data may be at risk if it can be reached through affected queries.

General mitigation guidance

Defensive approaches focus on preventing untrusted criteria from influencing SQL construction:

  • Allowlist supported criteria and reject or discard SQL-bearing properties that are not required.
  • Use parameterized query interfaces for values and avoid accepting caller-controlled SQL fragments.
  • Validate and normalize inputs before they reach query-building or configuration APIs.
  • Limit database account privileges to the minimum required by the application.
  • Keep template and control panel access restricted to trusted users, reducing exposure of the input path.

How teams detect issues like this

Review query-building paths for arbitrary criteria arrays passed into configuration or database APIs, especially properties such as orderBy and where.

Static analysis and code review can flag user-controlled values reaching SQL construction without allowlisting or parameterization. Runtime monitoring may also look for unusual control panel requests and repeated database queries whose outcomes vary conditionally. Policy checks can require parameterized queries and explicit validation of query criteria.

Sources

SourceLink
github.comgithub.com/craftcms/cms/security/advisories/GHSA-f6gf-r952-rxg6
vulncheck.comvulncheck.com/advisories/craft-cms-4.0.0-before-4.18.9-blind-sql-injection-via-getnext-getprev-criteria

Frequently asked

questions

The described attack requires an authenticated control panel user with the ability to supply relevant input that is processed by the affected template path.

No direct database login is described as necessary. The vulnerable application query path may provide conditional responses that act as an oracle.

Restrict criteria to an explicit allowlist, prevent untrusted input from controlling SQL fragments, and use parameterized query interfaces.

Validate input at trust boundaries, review query-building code for attacker-controlled properties, apply least privilege to database accounts, and enforce secure query patterns through testing and policy checks.

Find out what's already
exploitable in your codebase.