/

CVE-2026-105845

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Payload CMS Database Adapters

CVE-2026-105845

Undergoing Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database confidentiality, integrity, and availability compromise

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 CMS allows an untrusted user to influence database queries through dynamic filters or joins on readable collections. Under affected configurations, a crafted request may bypass query boundaries, expose or alter data, and potentially affect database availability.

A critical SQL injection vulnerability in Payload CMS allows an untrusted user to influence database queries through dynamic filters or joins on readable collections. Under affected configurations, a crafted request may bypass query boundaries, expose or alter data, and potentially affect database availability.

Affected context

The issue occurs in Payload CMS deployments using affected SQLite or PostgreSQL database adapters when untrusted users can query collections through dynamic filters or joins. Exploitation depends on the relevant collections being readable and the application passing user-controlled query conditions into database operations without adequate parameterization or structural validation.

The issue occurs in Payload CMS deployments using affected SQLite or PostgreSQL database adapters when untrusted users can query collections through dynamic filters or joins. Exploitation depends on the relevant collections being readable and the application passing user-controlled query conditions into database operations without adequate parameterization or structural validation.

Exploit preconditions

  • Attack surface: Payload CMS collection query endpoints
  • Required access: An untrusted or low-privileged account able to query readable collections
  • Trigger point: Dynamic filters or joins processed by the SQLite or PostgreSQL adapter
  • Why exploitation is possible: User-controlled query structures can influence SQL construction without sufficient separation between data and executable query syntax
  • Attack surface: Payload CMS collection query endpoints
  • Required access: An untrusted or low-privileged account able to query readable collections
  • Trigger point: Dynamic filters or joins processed by the SQLite or PostgreSQL adapter
  • Why exploitation is possible: User-controlled query structures can influence SQL construction without sufficient separation between data and executable query syntax

Why this happens

The underlying bug is an unsafe construction of SQL statements from attacker-influenced filter or join parameters. When application data is incorporated into query syntax instead of being safely parameterized and constrained to an approved query structure, database interpreters may treat that input as SQL logic rather than ordinary data. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

The underlying bug is an unsafe construction of SQL statements from attacker-influenced filter or join parameters. When application data is incorporated into query syntax instead of being safely parameterized and constrained to an approved query structure, database interpreters may treat that input as SQL logic rather than ordinary data. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

Potential impact

  • An attacker could read data from collections beyond the intended query scope
  • An attacker may alter or delete database records where write-capable paths are reachable
  • Sensitive application or tenant data could be exposed
  • Database availability could be degraded through resource-intensive queries
  • Application integrity and authorization assumptions could be undermined
  • An attacker could read data from collections beyond the intended query scope
  • An attacker may alter or delete database records where write-capable paths are reachable
  • Sensitive application or tenant data could be exposed
  • Database availability could be degraded through resource-intensive queries
  • Application integrity and authorization assumptions could be undermined

General mitigation guidance

Mitigation centers on ensuring that all database interactions separate query structure from user-controlled values.

Common defensive patterns include:

  • Using parameterized queries or trusted query-builder APIs for all variable values
  • Restricting filters, operators, joins, fields, and sort expressions to explicit allowlists
  • Validating query structures against collection-specific schemas before database execution
  • Applying authorization checks independently of user-supplied filters and joins
  • Limiting database credentials to the minimum permissions required by the application
  • Reducing direct exposure of dynamic query features for untrusted users
  • Treating database errors as non-sensitive and avoiding disclosure of generated SQL
  • Applying the vendor's security fixes through the organization's normal release-management process

Mitigation centers on ensuring that all database interactions separate query structure from user-controlled values.

Common defensive patterns include:

  • Using parameterized queries or trusted query-builder APIs for all variable values
  • Restricting filters, operators, joins, fields, and sort expressions to explicit allowlists
  • Validating query structures against collection-specific schemas before database execution
  • Applying authorization checks independently of user-supplied filters and joins
  • Limiting database credentials to the minimum permissions required by the application
  • Reducing direct exposure of dynamic query features for untrusted users
  • Treating database errors as non-sensitive and avoiding disclosure of generated SQL
  • Applying the vendor's security fixes through the organization's normal release-management process

How teams detect issues like this

Organizations can identify related risks through:

  • Static analysis rules for string concatenation or interpolation in SQL construction
  • Code review checks for dynamic filters, joins, ordering, and identifier handling
  • Testing that verifies query values are bound separately from SQL syntax
  • Runtime monitoring for anomalous query patterns, unexpected joins, and authorization mismatches
  • Database audit logging for unusual reads, modifications, or query failures
  • Policy enforcement requiring approved parameterized database-access libraries
  • Automated security testing of collection endpoints using authorized, non-destructive injection checks

Organizations can identify related risks through:

  • Static analysis rules for string concatenation or interpolation in SQL construction
  • Code review checks for dynamic filters, joins, ordering, and identifier handling
  • Testing that verifies query values are bound separately from SQL syntax
  • Runtime monitoring for anomalous query patterns, unexpected joins, and authorization mismatches
  • Database audit logging for unusual reads, modifications, or query failures
  • Policy enforcement requiring approved parameterized database-access libraries
  • Automated security testing of collection endpoints using authorized, non-destructive injection checks

Sources

SourceLink
github.comgithub.com/payloadcms/payload/commit/a742140ab4fca3160f7f83e9e7d996552ffc3b5a
github.comgithub.com/payloadcms/payload/releases/tag/v3.88.0
github.comgithub.com/payloadcms/payload/security/advisories/GHSA-v49j-62m6-pgrr

Frequently asked

questions

It may be exploitable through a network-accessible Payload CMS query endpoint when an untrusted user can query readable collections using dynamic filters or joins.

Not necessarily. The described condition requires access to a permitted collection-query capability, but it does not inherently require administrative privileges.

Separate SQL syntax from user-controlled values with parameterized queries, and validate dynamic query structures against strict allowlists before execution.

Combine secure database APIs with authorization checks, schema-based query validation, least-privilege database accounts, code review, and continuous testing of dynamic query features.

It may be exploitable through a network-accessible Payload CMS query endpoint when an untrusted user can query readable collections using dynamic filters or joins.

Not necessarily. The described condition requires access to a permitted collection-query capability, but it does not inherently require administrative privileges.

Separate SQL syntax from user-controlled values with parameterized queries, and validate dynamic query structures against strict allowlists before execution.

Combine secure database APIs with authorization checks, schema-based query validation, least-privilege database accounts, code review, and continuous testing of dynamic query features.

Find out what's already
exploitable in your codebase.