/

CVE-2026-61836

Severity:

HIGH RISK

(8.6)

Cache Key Authorization Bypass (CWE-639) in Directus API

CVE-2026-61836

Analyzed

Vulnerability type

Category:

Authorization Bypass via Caching

CWE:

CWE-524, CWE-639

Impact:

Privilege Escalation / Data Exposure

Severity:

HIGH RISK

(8.6)

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 cache key authorization flaw in Directus allows responses generated under one access context to be reused for other clients that share the same URL and query but have different permissions.

When response caching is enabled, missing authorization attributes in the cache key can cause share tokens and anonymous users to receive data filtered for a different permission set, making the issue risky anywhere diverse roles or share links are used.

Affected context

This vulnerability appears in Directus deployments that have HTTP response caching enabled in the API layer.

It manifests when cache keys are derived only from request-specific fields (version, path, query, accountability.user) while omitting critical authorization context such as share, role, roles, admin, app, and policies.

In environments that rely heavily on share tokens, anonymous access, or fine-grained role-based policies, the missing authorization attributes in the cache key can lead to cross-context reuse of permission-filtered responses.

Exploit preconditions

  • Attack surface: Directus API endpoints with response caching enabled.
  • Required access: Ability to issue HTTP requests (as an anonymous client, via share tokens, or as any user with differing roles/policies).
  • Trigger point: Two or more requests with identical URL, query parameters, and user null state, but distinct authorization contexts (e.g., different share tokens or policies).
  • Why exploitation is possible: The cache key omits authorization attributes (share, role, roles, admin, app, policies), allowing a response computed under one permission model to be served to another client whose request collapses to the same cache key.

Why this happens

The root cause is an incomplete cache key design that fails to encode all security-relevant facets of the caller's authorization state.

By relying primarily on path, query, version, and a single user identifier, the implementation treats multiple distinct authorization contexts as equivalent, particularly when accountability.user is null for both share tokens and anonymous clients.

This maps to CWE-639: Insecure Direct Object Reference in the sense that access control checks effectively become bypassable through cached state, and CWE-524: Use of Cached Data without Proper Validation because the cached response is reused without re-validating permissions for each new requester.

Potential impact

  • Clients with weaker or different permissions may receive data filtered for a more privileged share or role.
  • Sensitive records that should be hidden can be exposed to anonymous or low-privileged users.
  • Share links intended for narrow audiences can unintentionally leak broader dataset views.
  • Inconsistent enforcement of policies can undermine auditability and compliance efforts.

General mitigation guidance

Mitigation centers on making authorization context a first-class component of cache design and minimizing trust in previously computed responses.

Recommended high-level patterns include:

  • Incorporate all relevant authorization attributes (user identity, share token, role/roles, policy identifiers, admin/app flags) into cache keys or segregate caches per security principal.
  • Treat anonymous access and share-based access as distinct contexts with explicitly separate caching strategies.
  • Favor caching of non-sensitive, role-agnostic responses and avoid caching outputs that depend heavily on fine-grained policies, especially for multi-tenant or public APIs.
  • Re-evaluate permission filters on cache hits when feasible, or store sufficient policy metadata alongside cached entries to validate that the current requester's authorization matches the cached context.
  • Apply least-privilege principles to share tokens and roles so that any unintended data reuse is constrained.

How teams detect issues like this

High-level detection approaches include:

  • Reviewing cache key derivation functions for omission of security-relevant attributes such as roles, share identifiers, tenant IDs, and policy markers.
  • Using static analysis or configuration lints to flag caching logic that depends only on URL and query without incorporating authorization state.
  • Inspecting access logs for patterns where different principals (anonymous vs. share vs. authenticated users) receive identical payloads for policy-dependent endpoints.
  • Instrumenting cache middleware to log authorization context associated with each cached entry and monitoring for cross-context reuse.
  • Applying automated code review tools or custom rules in CI to enforce that any new caching mechanisms explicitly account for authentication and authorization boundaries.

Sources

SourceLink
github.comgithub.com/directus/directus/commit/7ba4efb97525d3af33570537c76e44baea767f13
github.comgithub.com/directus/directus/pull/27707
github.comgithub.com/directus/directus/releases/tag/v12.0.0
github.comgithub.com/directus/directus/security/advisories/GHSA-c6w9-5g5j-jh2p

Frequently asked

questions

Yes. Because anonymous requests and share-token requests can both map to a null user in the cache key, an unauthenticated client can potentially receive cached responses generated under a different authorization context.

The attacker only needs the ability to make HTTP requests to affected Directus endpoints. They do not require administrative access; differing roles, share tokens, or anonymous access patterns are sufficient where caching behavior collides.

The safest approach is to redesign cache keys and caching strategy so that every cached response is tightly bound to the full authorization context, or to avoid caching permission-dependent responses entirely. This ensures that no client can reuse data filtered for another principal's permissions.

Treat authorization state as a non-negotiable part of any caching or optimization mechanism, and formalize this in design reviews. Incorporate security-focused checks into code review and automated tooling to verify that new caches include identity, role, policy, and tenancy information, and periodically test endpoints for cross-user data leakage under varied roles and tokens.

Find out what's already
exploitable in your codebase.