/

CVE-2026-92087

Severity:

HIGH RISK

(8.1)

Authorization Bypass (CWE-285) in Fastify Auth Plugin

CVE-2026-92087

Awaiting Analysis

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-285, CWE-697

Impact:

Unauthorized Access and Privilege Escalation

Severity:

HIGH RISK

(8.1)

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 logic error in @fastify/auth can incorrectly authorize requests when nested authentication strategies are combined with specific "or", "and", and "all" options. An attacker who satisfies only the final check in an intended AND group may bypass a stricter authorization requirement, such as administrative access.

Affected context

The issue affects @fastify/auth configurations that compose multiple strategies using nested arrays and the run: "all" option. It is relevant when an outer relation combines strategy groups and the evaluation order allows a failed earlier check to be discarded, including configurations using an outer or with nested AND groups or an outer and with nested OR groups.

Exploit preconditions

  • Attack surface: Fastify routes protected by the @fastify/auth plugin
  • Required access: Ability to send requests to an affected protected route; valid credentials for a weaker or later-evaluated strategy may be sufficient
  • Trigger point: Authorization evaluation of nested strategy arrays with order-sensitive relation and run options
  • Why exploitation is possible: A failed check can be silently replaced by the result of the final check in a group, causing the route guard to return an authorization result that does not represent every required condition

Why this happens

The vulnerability results from incorrect aggregation of authentication and authorization results when nested strategy groups are evaluated with the run: "all" behavior.

Instead of preserving the failure of an earlier required check, the implementation can allow the final strategy result to determine the group's outcome. This is an authorization logic flaw mapped primarily to CWE-285: Improper Authorization, with CWE-697: Incorrect Comparison describing the order-dependent evaluation behavior.

Potential impact

  • Unauthorized users may access protected routes
  • Users with limited credentials could gain administrative functionality
  • API authorization boundaries may be bypassed
  • Sensitive data or privileged operations could become accessible
  • Downstream authorization assumptions may be weakened

General mitigation guidance

Mitigation generally focuses on making authorization composition explicit, order-independent, and fail-closed.

Common defensive patterns include:

  • Avoiding ambiguous nested strategy combinations when a direct top-level composition expresses the policy more clearly
  • Ensuring every required authorization condition must succeed before access is granted
  • Removing run: "all" where evaluating every strategy is not necessary
  • Designing group evaluation so failed required checks cannot be overwritten by later results
  • Applying least privilege to route permissions and separating authentication from administrative authorization
  • Adding tests for every permutation of strategy order, nesting, and relation settings
  • Keeping authentication and authorization dependencies within supported security-maintained release lines

How teams detect issues like this

Organizations can identify this class of issue through:

  • Static analysis and configuration review for nested authentication strategy arrays
  • Code review checks for relation and run combinations that depend on evaluation order
  • Authorization tests that reorder strategies and verify identical outcomes
  • Negative tests confirming that satisfying only one member of an AND group is insufficient
  • Policy enforcement requiring explicit, fail-closed route authorization definitions
  • Automated dependency and security review tools that flag affected library versions or authorization configuration patterns

Sources

SourceLink
cna.openjsf.orgcna.openjsf.org/security-advisories.html
github.comgithub.com/fastify/fastify-auth/security/advisories/GHSA-7h52-2rwr-m76r

Frequently asked

questions

Yes, when an affected authorization configuration protects a network-accessible Fastify route. The attacker still needs credentials or another condition that satisfies the strategy evaluated as the final successful check.

Not necessarily. A lower-privileged credential, such as a valid API key, may be enough if a stricter administrative check is evaluated earlier and its failure is discarded.

Use explicit, fail-closed authorization composition in which every required condition is independently enforced and group results cannot depend on strategy order.

Test authorization policies across strategy permutations, include negative and privilege-boundary cases, avoid ambiguous nested configuration, and enforce dependency and configuration review in CI.

Find out what's already
exploitable in your codebase.