/

CVE-2026-25544

Severity:

CRITICAL RISK

(9.8)

SQL Injection in Payload CMS JSON and richText Query

CVE-2026-25544

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authentication Bypass and Full Account Takeover via Blind SQL Injection

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

A critical SQL injection vulnerability in Payload, a headless CMS, allowed user-controlled input in JSON and richText queries to be embedded directly into SQL statements without proper escaping or parameterization.

An unauthenticated attacker could leverage blind SQL injection to extract sensitive data such as emails and password reset tokens, potentially leading to full account takeover without needing to crack passwords.

Affected context

The vulnerability occurs in Payload CMS instances that expose APIs allowing queries against JSON or richText fields, where user input influences filtering or searching behavior.

It is relevant in deployments where the application passes query parameters from HTTP requests into database queries without adequate sanitization or parameter binding.

The issue primarily affects scenarios where unauthenticated or low-privilege users can construct or influence complex queries over these fields (for example, search or filter endpoints) and the backend directly translates these into SQL conditions.

Exploit preconditions

  • Attack surface: Public or internal HTTP API endpoints that accept query parameters for JSON or richText fields.
  • Required access: Network access to the affected Payload CMS instance; no authentication is required if vulnerable endpoints are publicly exposed.
  • Trigger point: Submission of crafted query parameters that are interpolated into SQL statements used to search or filter content.
  • Why exploitation is possible: The application embeds user input directly into SQL fragments without proper escaping, validation, or use of prepared statements, enabling attackers to alter the intended database query logic and exfiltrate data via blind SQL injection techniques.

Why this happens

This vulnerability stems from constructing SQL queries by concatenating raw user input into query strings, rather than treating that input as data via parameterized queries.

When JSON or richText filter parameters are incorporated into SQL where clauses or expressions without robust escaping or binding, the database interprets injected tokens as part of the SQL language itself.

This aligns with CWE-89: SQL Injection, where insufficient neutralization of special elements in SQL commands allows attackers to change query semantics, bypass access controls, and access sensitive data.

Potential impact

  • Attackers may extract sensitive user data, including email addresses and account details.
  • Password reset tokens and other authentication-related secrets can be exfiltrated.
  • Full account takeover can occur without password cracking by abusing leaked reset tokens or similar secrets.
  • Application-level authorization boundaries can be bypassed, exposing data from multiple tenants or roles.
  • Integrity of stored content may be compromised through unauthorized inserts, updates, or deletions.
  • Broader database compromise may be possible if the application's database account has extensive privileges.

General mitigation guidance

Effective mitigation centers on treating all query-related user input as untrusted data and separating it from SQL control logic.

Recommended defensive patterns include:

  • Using parameterized queries (prepared statements) for all database interactions, including dynamic filters on JSON and richText fields.
  • Employing query builders or ORM abstractions that automatically bind parameters and avoid raw string concatenation.
  • Validating and constraining query parameters to an allowlist of supported fields, operators, and value types; reject or sanitize anything outside this contract.
  • Normalizing query interfaces so that clients cannot provide raw fragments of SQL or uncontrolled expressions.
  • Applying the principle of least privilege to the database account used by the CMS, granting only the minimal rights needed for standard operations.
  • Implementing centralized input validation and encoding routines for any feature that translates user input into query structures.

How teams detect issues like this

Detection efforts can focus on both code-level and runtime indicators:

  • Static analysis: Configure rules to flag any occurrence of string concatenation or interpolation in SQL query construction, especially where user-supplied parameters (e.g., HTTP query/body fields) are involved.
  • Code review signals: Look for patterns where JSON or richText search parameters are transformed directly into raw SQL fragments, custom where clauses, or literal expressions without parameter binding.
  • Policy enforcement: Introduce development guidelines requiring query builders or ORM APIs for database access, and prohibit direct execution of ad hoc SQL built from user input.
  • Runtime monitoring: Use database and application logs to detect anomalous query patterns, such as unusual predicates, timing-based probing, or repeated error-inducing requests characteristic of blind SQL injection attempts.
  • Automated security testing tools, including SAST and DAST specifically tuned for injection flaws, can be integrated into CI pipelines to surface similar issues early.

Sources

SourceLink
github.comgithub.com/payloadcms/payload/security/advisories/GHSA-xx6w-jxg9-2wh8

Frequently asked

questions

Yes. If the affected Payload CMS endpoints are exposed over the network, an external attacker can exploit the issue remotely by sending crafted HTTP requests to the vulnerable query interfaces.

No. The description indicates that exploitation is possible by an unauthenticated attacker, provided they can reach endpoints that accept JSON or richText queries and those inputs are mapped into SQL.

Refactor all database interactions to use parameterized queries or ORM/query-builder APIs that separate SQL logic from user input, and enforce strict schemas and allowlists for how JSON and richText queries are translated into database filters.

Establish a project-wide standard that prohibits building SQL strings from user input, require input validation libraries and safe query APIs in code review, and integrate automated security testing focused on injection weaknesses into the development lifecycle.

Find out what's already
exploitable in your codebase.