/

CVE-2026-27886

Severity:

HIGH RISK

(7.5)

Improper Query Sanitization / Injection-Adjacent Data

CVE-2026-27886

Analyzed

Vulnerability type

Category:

Improper Query Sanitization / Injection-Adjacent Data Exposure

CWE:

CWE-22, CWE-200, CWE-943

Impact:

Administrative Account Takeover via Sensitive Data Exposure

Severity:

HIGH RISK

(7.5)

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

Strapi's Content API query engine did not sufficiently sanitize where query parameters when filtering through relational fields such as updatedBy.

An unauthenticated attacker could craft boolean-oracle filters against public content types to infer sensitive data from the admin_users table, including password reset tokens, enabling full admin account takeover without prior access.

Affected context

This vulnerability appears in Strapi deployments that:

  • Run versions from 4.0.0 up to (but not including) the fixed release.
  • Expose at least one publicly-accessible Content API endpoint (e.g., unauthenticated GET on a collection type).
  • Have that content type related to admin_users (for example via updatedBy, createdBy, or other admin relations).
  • Allow clients to use where query parameters for filtering.

In these conditions, the query layer allows client-specified filters to traverse into relational admin fields that should otherwise be hidden, leaking information via response characteristics rather than direct field exposure.

Exploit preconditions

  • Attack surface: Public Content API endpoints that support query filters (e.g., ?where[...]).
  • Required access: No authentication required; any external caller can send crafted HTTP requests.
  • Data model requirement: At least one public content type must have a relation to admin_users (such as updatedBy), or another administrative relation.
  • Trigger point: Use of relational filter chains in query parameters, e.g. where[updatedBy][resetPasswordToken][$startsWith]=....
  • Why exploitation is possible: The query parameter sanitization layer validates the syntactic correctness of filters but does not enforce authorization boundaries on relational traversal. As a result, it allows parameter chains that join into tables and columns the caller has no read rights on. The resulting LEFT JOIN and WHERE clause cause observable changes (e.g., result counts), which become a one-bit oracle over the contents of fields like resetPasswordToken.

Why this happens

The core issue is improper query parameter sanitization and authorization enforcement in the query-building pipeline.

When a client supplies filters via the where parameter, Strapi constructs SQL (or ORM-level) queries that may traverse relationships, such as from a public content type to the admin_users table through updatedBy.

The sanitization layer primarily checks that filters are syntactically valid and align with allowed operators, but it fails to restrict which relational paths can be queried based on the caller's permissions.

This leads to a condition described by CWE-943: Improper Neutralization of Special Elements in Data Query Logic combined with CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.

Rather than a classic SQL injection, the bug is a logical injection into the query semantics: untrusted query structure is accepted and used to generate joins and conditions referencing sensitive fields, effectively exposing them through a boolean-oracle side channel.

Potential impact

  • An attacker may extract administrator resetPasswordToken values bit by bit using crafted boolean-oracle filters.
  • An attacker could perform full administrative account takeover by leveraging stolen reset tokens in the legitimate password reset flow.
  • Sensitive administrative metadata (e.g., whether certain admin fields match a predicate) could be inferred without direct read permissions.
  • The compromise of an admin account may enable further configuration changes, data exfiltration, or injection of malicious content across the CMS.

General mitigation guidance

Effective mitigation focuses on tightening query-parameter handling, enforcing authorization on relational traversal, and reducing what is exposed on public endpoints:

  • Constrain relational traversal in filters: Implement strict validation that disallows filter chains crossing into schemas or relationships the caller is not authorized to read, even if the base content type is public.
  • Layer authorization at the query boundary: Apply permission checks not just at the route or model level, but also at the query-construction stage so relational joins and field references are subject to the same access control rules.
  • Use explicit allow-lists for filterable fields: Define a restricted list of fields (and relations) that can be referenced from where parameters on public endpoints; drop or reject all others.
  • Normalize and sanitize operators: Restrict supported operators and chains ($startsWith, $gt, etc.) to those that are safe and expected, and validate their targets against policy.
  • Minimize sensitive relations on public types: Avoid binding administrative entities like admin_users directly to publicly readable content types, or decouple those relations from public query interfaces where possible.
  • Harden authentication recovery flows: Treat reset tokens and similar secrets as highly sensitive and ensure additional safeguards (short expiration, one-time use, secondary confirmation) so that token leakage has reduced blast radius.

How teams detect issues like this

Detection can leverage both code-level analysis and runtime monitoring:

  • Static analysis and code review:
  • Search for controller or service logic that forwards raw where or filter parameters directly into query builders without permission-aware sanitization.
  • Review relationship mappings from public content types to administrative entities (such as admin_users) and verify that query filters cannot traverse those relations.
  • Look for generic query-building helpers that accept arbitrary nested filter objects and ensure they enforce field- and relation-level authorization.
  • Automated policy enforcement:
  • Add linting or schema-validation rules that flag public routes whose filters reference admin relations or sensitive fields by name.
  • Use automated API contract testing to verify that attempts to filter on restricted relational fields are rejected with clear errors rather than producing valid responses.
  • Runtime and log monitoring:
  • Monitor for patterns of highly repetitive filter requests with systematically varying predicates (e.g., $startsWith iterating over character sets) which indicate oracle-style probing.
  • Instrument query logs to detect unexpected joins from public content tables into admin_users or other privileged tables initiated by anonymous requests.

Sources

SourceLink
github.comgithub.com/strapi/strapi/security/advisories/GHSA-rjg2-95x7-8qmx

Frequently asked

questions

Yes. Any unauthenticated client with network access to a vulnerable Strapi Content API endpoint can exploit the issue by sending crafted HTTP requests with relational filter chains.

No. Exploitation relies on public content types with relations to admin_users (or similar admin entities). No pre-existing credentials are required as long as the endpoint is publicly reachable.

The strongest fix is to enforce strict, permission-aware sanitization of query parameters at the controller and service boundary. Only allow filters and relational paths that are explicitly approved for the caller's role, and reject any filter chain that attempts to traverse into restricted schemas like admin_users.

Treat query shape and relational traversal as part of your authorization surface. Design query builders that:

  • Operate on whitelisted fields and relations.
  • Check access control rules before constructing joins or referencing fields.
  • Normalize and validate filter operators.

Combine this with regular security reviews, static checks for unsafe query propagation, and tests that attempt to filter on known restricted fields to confirm they are consistently rejected.

Find out what's already
exploitable in your codebase.