/

CVE-2026-33729

Severity:

CRITICAL RISK

(9.8)

Authorization Logic and Caching Flaws in OpenFGA

CVE-2026-33729

Analyzed

Vulnerability type

Category:

Authorization Logic and Caching Flaws

CWE:

CWE-20, CWE-345, CWE-1289

Impact:

Incorrect Authorization Decisions

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

OpenFGA versions prior to 1.13.1 contain a flaw in how cache keys are derived for authorization checks that use conditions, allowing two distinct requests to generate the same cache key.

Under specific modeling patterns with condition-based relations and caching enabled, OpenFGA may reuse a cached decision from a different request, potentially granting or denying access incorrectly.

Affected context

This issue arises in OpenFGA deployments that:

  • Use models with relations relying on condition evaluation (e.g., context-dependent access rules), and
  • Have caching enabled for authorization checks.

In these scenarios, the cache key derivation logic may not fully capture all inputs that influence the decision (such as specific condition parameters or contextual attributes). When two semantically different authorization checks collapse to the same cache key, OpenFGA may return a prior cached result instead of computing the correct one for the new request.

Exploit preconditions

  • Attack surface: Authorization/check API endpoints exposed by OpenFGA.
  • Required access: Ability to issue or influence authorization check requests (e.g., as an application client or user whose requests are checked through OpenFGA).
  • Trigger point: Check operations against relations that rely on conditional logic while the cache is enabled.
  • Why exploitation is possible: The cache key does not uniquely represent all decision-relevant inputs (including condition parameters and contextual data), so different checks can collide on the same key and cause the engine to reuse a stale or incorrect authorization result.

Why this happens

The vulnerability stems from insufficiently robust cache key construction for conditional authorization checks.

Instead of including all security-sensitive inputs (such as relation, user, object, and condition parameters) into the cache key, the implementation allows logically distinct requests to hash to the same key.

This aligns with:

  • CWE-345: Insufficient Verification of Data Authenticity, because the system trusts a cached result without adequately verifying that it was produced for the exact same decision context.
  • CWE-20: Improper Input Validation, as the inputs that drive authorization logic are not fully reflected or validated in the caching layer.
  • CWE-1289: Improper Validation of Syntactic Correctness of Input, in that the structural distinctions between different conditional inputs are not reliably encoded when deriving cache identifiers.

Abstractly, this is a logic bug where an optimization (caching) breaks the invariant that each authorization decision is bound to its full set of inputs.

Potential impact

  • Authorization checks may incorrectly grant access to resources that should be denied.
  • Authorization checks may incorrectly deny access to resources that should be permitted.
  • Confusing or inconsistent behavior in applications relying on OpenFGA, potentially undermining auditability and trust in access control decisions.
  • Depending on the protected data, could contribute to data exposure, privilege escalation, or bypass of business rules.

General mitigation guidance

Mitigation typically focuses on ensuring that caching cannot conflate distinct authorization contexts:

  • Design cache keys so they uniquely encode all decision-relevant inputs, including user, object, relation, and every condition parameter or contextual attribute that affects the outcome.
  • Treat condition evaluation inputs as part of the security boundary; avoid any normalization or truncation that can cause distinct inputs to collide in the cache.
  • Where modeling patterns are complex, prefer defensive defaults: disable or narrow caching on relations that depend heavily on dynamic context or fine-grained conditions.
  • Apply the principle of least privilege in model design so that accidental cache reuse tends to under-grant rather than over-grant access.
  • Introduce invariants and tests around authorization behavior to ensure that changes to caching or modeling do not alter expected decisions.

These measures help ensure that performance optimizations do not compromise authorization correctness.

How teams detect issues like this

Detection efforts can combine code analysis, configuration review, and behavioral monitoring:

  • Static analysis and code review:
  • Look for cache implementations where keys omit condition-related inputs or contextual parameters.
  • Flag any caching layer that keys only on user/object/relation while the authorization logic also depends on additional context.
  • Review helper functions that build cache keys, ensuring they evolve alongside changes to the authorization model.
  • Policy and configuration review:
  • Examine models to identify relations heavily dependent on conditions and confirm that caching strategies are appropriate for them.
  • Establish architectural guidelines that condition-based relations receive special scrutiny before being cached.
  • Runtime and log-based analysis:
  • Analyze logs for suspicious patterns, such as users gaining access in contexts where conditions should differ (e.g., different times, locations, or attributes) but responses are identical and served from cache.
  • Correlate cache hits with input variability to detect potential key collisions.
  • Automated code review or security scanning tools can be configured with rules to flag risky cache key patterns in authorization code.

Sources

SourceLink
github.comgithub.com/openfga/openfga/commit/049b50ccd2cc7e163bd897f3d17a7b859ad146f8
github.comgithub.com/openfga/openfga/releases/tag/v1.13.1
github.comgithub.com/openfga/openfga/security/advisories/GHSA-h6c8-cww8-35hf

Frequently asked

questions

Yes, in typical deployments it can be triggered remotely through any client or service that can cause authorization checks to be executed against OpenFGA. The attacker does not need direct access to OpenFGA internals; influencing or making check requests is sufficient.

The attacker must be able to send or influence authorization check requests that use conditional relations in a model where caching is enabled. This commonly corresponds to being an authenticated or semi-trusted user of an application that delegates access control to OpenFGA.

The safest pattern is to make cache keys fully parameterized by all inputs that can affect the decision, or to disable caching for condition-heavy relations where that guarantee cannot be upheld. After adjusting cache key construction, thoroughly test to ensure no decision is served from a cache entry that was computed under a different context.

Treat authorization logic and caching as tightly coupled security-sensitive components. When evolving the authorization model (especially adding new condition parameters), update cache key derivation in lockstep, enforce code reviews that focus on cache correctness, and add automated tests that compare decisions with and without cache to ensure they remain identical across varied inputs.

Find out what's already
exploitable in your codebase.