/

CVE-2026-123488

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Craft CMS Element Search

CVE-2026-123488

Awaiting Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized database access and potential administrator account takeover

Severity:

CRITICAL RISK

(9.8)

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 has an unauthenticated SQL injection vulnerability in its element search endpoint because an attribute parameter is incorporated into a query unsafely. A remote attacker may be able to read or modify database contents and could alter user records to gain administrator access.

Affected context

The vulnerability affects Craft CMS 4.0.0 before 4.18.9 and 5.0.0 before 5.11.2. It occurs in the element search endpoint when the attribute parameter is used to build a database query without adequate sanitization, in a configuration where emulated PDO prepares permit stacked statements.

Exploit preconditions

  • Attack surface: Craft CMS element search endpoint
  • Required access: No authentication is required, according to the vulnerability description
  • Trigger point: Processing a search request that uses the attribute parameter
  • Why exploitation is possible: The parameter is concatenated into a query, and emulated PDO prepares may allow stacked statements

Why this happens

The application constructs SQL using an externally supplied parameter rather than safely separating query structure from data. This is an SQL injection flaw, mapped to CWE-89, and the use of emulated prepares that allow stacked statements can increase the range of possible database operations.

Potential impact

  • An attacker may read sensitive data from the database
  • An attacker could modify or overwrite database records
  • User account data may be altered to enable administrator access
  • Application data integrity and confidentiality may be compromised

General mitigation guidance

Defensive patterns include using parameterized queries that keep user-controlled values separate from SQL syntax and disabling emulated prepares where they weaken statement handling. Where query structure cannot be parameterized, such as dynamic identifiers, accept only values from a strict allowlist. Limit database account privileges to the operations the application requires, and avoid exposing sensitive database behavior through unauthenticated endpoints.

How teams detect issues like this

  • Use static analysis to identify SQL construction through string concatenation or interpolation of request parameters.
  • Review database access code for dynamic identifiers, unsafe query builders, and reliance on emulated prepares.
  • Apply code-review and CI policies that require parameter binding for user-controlled values.
  • Monitor for unexpected database errors, unusual stacked statements, and unauthorized changes to user or administrator records.

Sources

SourceLink
github.comgithub.com/craftcms/cms/security/advisories/GHSA-qcvp-ggx3-97r6
vulncheck.comvulncheck.com/advisories/craft-cms-4.0.0-before-4.18.9-sql-injection-via-element-search-endpoint

Frequently asked

questions

Yes. The described attack surface is the Craft CMS element search endpoint, and the vulnerability is unauthenticated.

No authenticated access is required, according to the description. The attacker must be able to reach the affected endpoint.

Use parameterized queries that treat input strictly as data, and avoid emulated prepare behavior that permits stacked statements.

Keep query structure separate from user input, allowlist dynamic identifiers, apply least privilege to database accounts, and include SQL-construction checks in code review and automated analysis.

Find out what's already
exploitable in your codebase.