CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-137181

CVE-2026-137181: Incorrect Authorization via Improper Context Cancellation Propagation in OpenFGA

Amit Schendel
Amit Schendel
Senior Security Researcher

Dec 1, 2026·9 min read·3 visits

Executive Summary (TL;DR)

OpenFGA versions >= 1.10.3 and < 1.23.0 improperly handle context cancellations and timeouts during concurrent permission graph traversal. In authorization models utilizing set operators like 'but not', a timed-out exclusion check is treated as an empty set rather than an evaluation error, resulting in unauthorized access grants and potential query cache poisoning.

CVE-2026-137181 (GHSA-637h-v79h-mvqf) is an incorrect authorization vulnerability (CWE-863) in OpenFGA versions 1.10.3 through 1.22.x. The graph evaluation engine fails to distinguish between normal stream exhaustion and context cancellations or deadline exceedances during concurrent set evaluations. When resolving models using relational set operations (and, or, but not), an aborted worker branch can be evaluated as empty rather than errored, causing the engine to return unauthorized access grants (Allowed: true). When query caching is enabled, these erroneous evaluation states can be persisted to the in-memory cache, poisoning subsequent authorization checks.

Vulnerability Overview

OpenFGA is an open-source relationship-based access control (ReBAC) engine modeled after Google Zanzibar. Applications query OpenFGA via gRPC or HTTP APIs to make fine-grained authorization decisions based on stored relationship tuples and an authorization model. The engine exposes four primary evaluation endpoints: Check, BatchCheck, ListObjects, and StreamedListObjects.

In versions starting from 1.10.3 and prior to 1.23.0, OpenFGA contains an incorrect authorization flaw classified under CWE-863. The vulnerability was introduced in commit 293893b22a53d8a130a5f7c97cab4bc8e91bcaa4, which refactored how concurrent streaming iterators and graph reducers process relational set operators (and, or, and but not). Under this implementation, worker goroutines traverse different branches of the authorization graph concurrently and stream matching objects or subjects over Go channels.

When a request encounters a server-side deadline exceedance (context.DeadlineExceeded) or a client-initiated context cancellation (context.Canceled), the graph evaluation engine fails to propagate the error state reliably across all worker branches. Instead of aborting the entire permission evaluation, certain iterator consumers treat the cancelled stream as cleanly exhausted (EOF).

Consequently, partial or incomplete intermediate results are processed by top-level set reducers as valid data. In models that rely on set difference (but not) to enforce negative permissions or exclusions, a cancellation on the exclusion branch causes the engine to omit the restriction and return Allowed: true. Furthermore, if query caching (--check-query-cache-enabled) is active, the engine can store these corrupted evaluation outcomes in memory, affecting subsequent requests from other clients.

Root Cause Analysis

The root cause of CVE-2026-137181 consists of three distinct flaws in how OpenFGA handles Go context.Context lifecycles, iterator termination states, and cache writes across concurrent graph resolution workers.

The primary flaw lies in the conflation of normal iterator completion with context cancellation inside internal/iterator/stream.go and internal/graph/weight_two_resolver.go. When reading from tuple streams, the consumer loops invoked storage.IterIsDoneOrCancelled(err) to decide whether to break out of the loop normally or record an error. Because IterIsDoneOrCancelled returned true for storage.ErrIteratorDone, context.Canceled, and context.DeadlineExceeded, a cancelled worker goroutine exited its producer loop without setting an error flag.

This ambiguity directly breaks the set difference operator (fastPathDifference), which calculates Base - Difference for but not relations. One goroutine streams candidate items from the Base relation while a second goroutine streams items to exclude from the Difference relation. If the Difference stream times out or is cancelled mid-execution, the consumer loop treats the Difference iterator as exhausted. It then drains and outputs all remaining items from the Base stream without applying the remaining exclusions. Additionally, fastPathUnion, fastPathIntersection, and fastPathDifference utilized a defer block that unconditionally flushed any buffered items in batch downstream via TrySendThroughChannel, emitting incomplete sets even when a loop terminated due to an error.

The second flaw occurs at the strategy execution boundary in internal/check/check.go (executeStrategy) and internal/graph/check.go (profiledCheckHandler). When a strategy closure fn() returned a result alongside err == nil, the caller did not inspect ctx.Err(). If a concurrent branch had failed silently due to cancellation and yielded a default or partial response, the top-level handler accepted the response as authoritative.

The third flaw resides in internal/graph/cached_resolver.go within CachedCheckResolver.ResolveCheck. After invoking c.delegate.ResolveCheck(ctx, req), the caching layer checked only whether err != nil. It did not verify whether ctx.Err() != nil before cloning the response and committing it to the cache via c.cache.Set(). Any incomplete evaluation produced during a cancellation race was immediately cached until the configured TTL expired.

Code Analysis

The vulnerability was resolved in commit 9b420733fc2ef7607e3287405ebaad144c90775e. The patch modifies iterator error inspection, deferred batch flushing, top-level context validation, and query cache guards.

In internal/graph/weight_two_resolver.go and internal/iterator/stream.go, the patch replaces storage.IterIsDoneOrCancelled(err) with explicit checks against storage.ErrIteratorDone. This ensures that context.Canceled and context.DeadlineExceeded are captured and propagated as errors.

--- a/internal/graph/weight_two_resolver.go
+++ b/internal/graph/weight_two_resolver.go
@@ -171,11 +175,10 @@ ConsumerLoop:
 				t, err := msg.Iter.Next(ctx)
 				if err != nil {
 					msg.Iter.Stop()
-					if storage.IterIsDoneOrCancelled(err) {
-						break
+					if !errors.Is(err, storage.ErrIteratorDone) {
+						lastErr = err
 					}
-					lastErr = err
-					continue
+					break
 				}

In internal/iterator/stream.go, the fast-path set reducer functions (fastPathUnion, fastPathIntersection, and fastPathDifference) were updated to remove batch emission from the defer cleanup block and to verify stream errors before draining remaining elements:

--- a/internal/iterator/stream.go
+++ b/internal/iterator/stream.go
@@ -368,9 +368,6 @@ func fastPathDifference(ctx context.Context, streams []*Stream, out chan<- *Msg)
 	defer func() {
-		if len(batch) > 0 {
-			 concurrency.TrySendThroughChannel(ctx, &Msg{Iter: storage.NewStaticIterator[string](batch)}, out)
-		}
 		drainStreams(streams)
 	}()

Specifically within fastPathDifference, when the diffStream encounters an error on NextItem(ctx), the patched code now checks !errors.Is(err, storage.ErrIteratorDone), forwards the error through the output channel, and returns immediately rather than falling through to drain the baseStream:

@@ -395,8 +392,9 @@ func fastPathDifference(ctx context.Context, streams []*Stream, out chan<- *Msg)
 			if diffHead == "" {
 				diffHead, err = diffStream.NextItem(ctx)
 				if err != nil {
-					if !storage.IterIsDoneOrCancelled(err) {
+					if !errors.Is(err, storage.ErrIteratorDone) {
 						concurrency.TrySendThroughChannel(ctx, &Msg{Err: err}, out)
+						return
 					}
 					// diff is fully exhausted, process the rest of base
 					break
 				}
 			}

To prevent strategy executors and cache resolvers from returning or storing results when the parent context is no longer valid, explicit ctx.Err() checks were added to internal/check/check.go and internal/graph/cached_resolver.go:

--- a/internal/check/check.go
+++ b/internal/check/check.go
@@ -357,6 +357,9 @@ func (r *Resolver) executeStrategy(ctx context.Context, selector planner.Selecto
 	res, err := fn()
 	duration := time.Since(start)
 	span.SetAttributes(attribute.Int64("strategy_duration_ms", duration.Milliseconds()))
+	if err == nil {
+		err = ctx.Err()
+	}
 	if err != nil {
 
--- a/internal/graph/cached_resolver.go
+++ b/internal/graph/cached_resolver.go
@@ -197,6 +197,10 @@ func (c *CachedCheckResolver) ResolveCheck(
 		return resp, nil
 	}
 
+	if ctx.Err() != nil {
+		return resp, nil
+	}
+
 	clonedResp := resp.clone()

The fix systematically addresses all affected reducer paths (union, intersection, difference, and weight-2 resolvers) and includes comprehensive regression tests in internal/graph/cancelled_resolution_test.go. No incomplete fix paths or bypass vectors were identified in the patched reducers.

Exploitation

Exploiting CVE-2026-137181 requires an authenticated caller (or an application proxying requests on behalf of an authenticated user) capable of triggering Check, BatchCheck, ListObjects, or StreamedListObjects queries against an OpenFGA instance. The target store's authorization model must contain at least one relation defined using relational set operators (and, or, or but not). Additionally, for ListObjects and StreamedListObjects, the vulnerability only manifests when --listObjects-pipeline-enabled=false.

The primary exploitation scenario targets negative permission rules defined with the but not difference operator. Consider an authorization model containing the following definition:

type user
 
type document
  relations
    define viewer: [user]
    define blocked: [user]
    define can_view: viewer but not blocked

Assume user:anne is assigned to both viewer and blocked for document:budget, meaning her effective access to can_view must evaluate to Allowed: false. To trigger the bypass, the evaluation of the blocked relation branch must be interrupted by a context cancellation or deadline exceedance after the viewer branch has yielded user:anne, but before the blocked branch emits user:anne.

An attacker can induce this state through two primary mechanisms:

  1. Server-Side Deadline Exhaustion: Increasing database latency or concurrency contention (for example, by issuing parallel complex queries that saturate connection pools or worker threads) so that the server-side request timeout expires right as fastPathDifference awaits the diffStream.NextItem(ctx) response.
  2. Client Cancellation Race with Cache Poisoning: When --check-query-cache-enabled is active, a client with direct API access or predictable request cancellation timing can send a Check query and terminate the HTTP/gRPC connection after a calibrated delay (e.g., a few milliseconds). If the cancellation signal arrives after the base branch resolves but before the exclusion or sub-problem finishes, CachedCheckResolver stores the partial result in memory. Any subsequent query for the same tuple will receive the poisoned cached decision until the cache entry expires.

> [!NOTE] > While no standalone weaponized PoC repositories have been published in the wild, the official fix commit includes deterministic unit tests in internal/graph/cancelled_resolution_test.go (such as TestCachedCheckResolverDoesNotCacheResolutionWithCancelledContext and TestWeight2ReportsCancellationWhenCancelledAfterNonMatchingItems) that demonstrate how cancelled sub-iterators previously caused resolvers to suppress errors and cache invalid outcomes.

Impact Assessment

The primary security impact of CVE-2026-137181 is an authorization bypass resulting in privilege escalation. Because OpenFGA acts as the central policy decision point (PDP) for upstream applications, returning a false Allowed: true response causes the calling service (the policy enforcement point) to grant an unauthorized actor access to protected data or privileged operations.

The vulnerability is rated High severity with a CVSS v4.0 base score of 7.1 (CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:H/SI:H/SA:N). The Attack Vector is Network (AV:N) with Low Attack Complexity (AC:L), while Attack Requirements are Present (AT:P) due to the race window required for context cancellation or deadline expiration to coincide with specific stages of multi-branch stream evaluation.

On the vulnerable OpenFGA system itself, the impact is concentrated on Integrity (VI:H), as the engine produces erroneous authorization assertions and potentially corrupts its internal query cache. Confidentiality (VC:N) and Availability (VA:N) of the OpenFGA host are unaffected.

On subsequent downstream systems relying on OpenFGA decisions, both Confidentiality (SC:H) and Integrity (SI:H) impacts are High. An adversary who bypasses a but not exclusion or poisons a cached check can read restricted records or execute unauthorized state-changing operations within the relying application.

Remediation

The definitive remediation is to upgrade OpenFGA to version 1.23.0 or later. Version 1.23.0 incorporates commit 9b420733fc2ef7607e3287405ebaad144c90775e, which enforces strict storage.ErrIteratorDone verification across all stream iterators, checks ctx.Err() prior to returning strategy results, prevents cancelled resolvers from flushing partial batches, and blocks cache writes on cancelled contexts.

For containerized deployments and Go module integrations, apply the update using the following commands:

# Update Docker container image
docker pull openfga/openfga:v1.23.0
 
# Update Go library dependency
go get github.com/openfga/openfga@v1.23.0

If an immediate upgrade to v1.23.0 cannot be performed, operators can apply configuration workarounds to reduce exposure:

  1. Disable Query Caching: Prevent transient timeout errors or client-triggered cancellations from persisting poisoned authorization states across requests by setting --check-query-cache-enabled=false (or the environment variable OPENFGA_CHECK_QUERY_CACHE_ENABLED=false).
  2. Enable the ListObjects Pipeline: The vulnerability only affects ListObjects and StreamedListObjects when the legacy resolver path is used. Ensure --listObjects-pipeline-enabled=true is configured.
  3. Increase Request Timeout Thresholds: Tune server-side HTTP/gRPC upstream timeouts and database connection pool limits to minimize the probability of legitimate queries hitting context.DeadlineExceeded during peak load.

Official Patches

OpenFGAOfficial Security Fix Commit
OpenFGAOpenFGA Release v1.23.0
OpenFGAGitHub Security Advisory GHSA-637h-v79h-mvqf

Fix Analysis (1)

Technical Appendix

CVSS Score
7.1/ 10
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:H/SI:H/SA:N

Affected Systems

OpenFGA (>= 1.10.3, < 1.23.0)

Affected Versions Detail

Product
Affected Versions
Fixed Version
OpenFGA
openfga
>= 1.10.3, < 1.23.01.23.0
AttributeDetail
CVE IDCVE-2026-137181 (GHSA-637h-v79h-mvqf)
Weakness ClassCWE-863: Incorrect Authorization
CVSS v4.0 Score7.1 High (CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:H/SI:H/SA:N)
Affected VersionsOpenFGA >= 1.10.3, < 1.23.0
Patched VersionOpenFGA 1.23.0
Affected EndpointsCheck, BatchCheck, ListObjects, StreamedListObjects
ImpactUnauthorized access grant (Allowed: true) and query cache poisoning
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-863
Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.

Vulnerability Timeline

CVE-2026-137181 and GitHub Security Advisory GHSA-637h-v79h-mvqf published
2026-11-30
OpenFGA v1.23.0 released containing fix commit 9b420733fc2ef7607e3287405ebaad144c90775e
2026-11-30

References & Sources

  • [1]GitHub Security Advisory: GHSA-637h-v79h-mvqf
  • [2]OpenFGA Official Fix Commit (9b420733fc2ef7607e3287405ebaad144c90775e)
  • [3]OpenFGA Release v1.23.0
  • [4]CVE.org Record: CVE-2026-137181
  • [5]NVD National Vulnerability Database: CVE-2026-137181
  • [6]CVEListV5 JSON Record: CVE-2026-137181

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•38 minutes ago•CVE-2026-139996
7.4

CVE-2026-139996: Prototype Pollution in React Router via Vendored turbo-stream Deserializer

CVE-2026-139996 is a prototype pollution vulnerability (CWE-1321) in React Router's vendored turbo-stream deserializer, utilized in Framework mode for single-fetch transitions and client-server hydration. When unflattening serialized streams, the decoder assigns object properties using direct bracket notation (object[key] = value) rather than defining own properties via Object.defineProperty. Furthermore, the deserializer lacks integer and bounds validation on stream reference indices. An attacker capable of supplying crafted turbo-stream payloads to the deserializer can pollute Object.prototype or trigger arbitrary index dereferences, compromising application integrity and confidentiality.

Amit Schendel
Amit Schendel
1 views•9 min read
•about 3 hours ago•CVE-2026-137200
7.5

CVE-2026-137200: Denial of Service via Unhandled Upgrade Error in Engine.IO

An uncaught exception vulnerability (CWE-248) in Engine.IO versions prior to 6.6.12 allows remote unauthenticated attackers to cause a Denial of Service (DoS) against Node.js applications utilizing Engine.IO or Socket.IO. By sending an HTTP upgrade request targeting a non-Engine.IO URL path and forcibly resetting the underlying TCP connection before the internal destruction timeout expires, an attacker triggers an unhandled ECONNRESET error event on the socket object, terminating the entire Node.js runtime process.

Alon Barad
Alon Barad
5 views•10 min read
•about 4 hours ago•CVE-2026-137199
9.2

CVE-2026-137199: OS Command Injection in cross-spawn on Windows via Batch File Argument Escaping Bypass

CVE-2026-137199 (GHSA-ghv9-86vm-4v8m) is a critical OS command injection vulnerability in the Node.js cross-spawn library affecting versions prior to 6.0.7 and 7.1.0 on Windows. The vulnerability stems from incomplete metacharacter escaping when routing batch scripts (.bat and .cmd) outside of node_modules/.bin through cmd.exe, alongside flaws in file extension canonicalization, environment variable expansion, and line break handling. Attackers who control arguments passed to batch scripts can break out of argument quoting and execute arbitrary system commands.

Alon Barad
Alon Barad
5 views•15 min read
•about 5 hours ago•GHSA-CX3C-RMCX-FF35
5.9

GHSA-cx3c-rmcx-ff35: Metadata Partition-Key Collisions in OpenTelemetry Collector exporterhelper

An improper data encoding vulnerability (CWE-172) exists in the OpenTelemetry Collector exporterhelper package between versions 0.147.0 and 0.163.x. When metadata-partitioned batching is enabled with multiple metadata keys, the partition key generator uses an unescaped null byte delimiter to concatenate key names and multi-valued header arrays. An authenticated attacker capable of sending multi-valued HTTP or gRPC headers to an ingress receiver can induce partition key collisions, causing cross-tenant telemetry data mixture, data poisoning, or unauthorized data exfiltration.

Alon Barad
Alon Barad
9 views•10 min read
•about 6 hours ago•CVE-2026-137187
5.4

CVE-2026-137187: Fail-Open Project Allowlist Authorization Bypass in @zereight/mcp-gitlab

CVE-2026-137187 (GHSA-5xhm-p3jx-2fmc) is a missing authorization vulnerability (CWE-862) in @zereight/mcp-gitlab affecting versions 2.2.5 through 2.3.6. The flaw exists within the gitlab_api_request tool, where project allowlist enforcement fails open when evaluating API paths that do not conform to the /projects/:id pattern or when following HTTP redirects to an empty relative path. Attackers or compromised LLM agents with access to the api toolset can bypass project isolation boundaries to query or modify group, user, and instance-level GitLab resources permitted by the server's underlying authentication token.

Alon Barad
Alon Barad
8 views•10 min read
•about 8 hours ago•GHSA-R73Q-GWX2-FPXM
6.8

GHSA-r73q-gwx2-fpxm: Arbitrary Host Directory Mount and Sandbox Bypass via Theme Module Replacements in Hugo

Hugo versions 0.152.0 through 0.167.x contain a path traversal and sandbox bypass vulnerability in the module configuration loader. When a root project does not define module replacements, Hugo permits imported themes or modules to define their own module.replacements directives. Because replaced module imports are internally marked as project-replaced, they bypass theme directory path restrictions, allowing an untrusted theme to mount arbitrary host filesystem directories and expand the Node.js read sandbox.

Amit Schendel
Amit Schendel
8 views•10 min read