ZeroHour

CVE-2026-92087

moderate

Order-Dependent Authorization Bypass in @fastify/auth 5.x

CVSS 3.1
8.1 high
EPSS
Published
()
Modified
AI analysis

@fastify/auth versions 5.0.0 through 5.1.0 mishandle nested strategy groups: when strategies are composed with the 'or' relation together with the run 'all' option and one entry is a nested array acting as an AND group, evaluation is order-dependent, so an earlier failing check is silently dropped and the group's result becomes the outcome of its last check. As a result, a request that satisfies only the final member of an AND group — for example, a caller holding a valid API key but lacking administrator rights — is authorized instead of rejected, granting access or privileges the AND group was intended to deny; a mirrored order-dependent bypass affects configurations where the top-level relation is 'and' with a nested 'or' group. Any application using @fastify/auth 5.0.0–5.1.0 with these specific compositions is affected, and exploitation requires only a low-privileged identity that satisfies the last check in the group (no user interaction). No public proof-of-concept, CISA KEV listing, or confirmed in-the-wild exploitation is currently known.

What to do: Upgrade to @fastify/auth 5.1.1 or later. If upgrading is not immediately possible, audit route definitions for the 'or' relation combined with run 'all' (and the mirrored top-level 'and' with nested 'or' groups), omit run 'all' where it is not required, order each AND group so its stricter check is evaluated last, or replace nested AND groups with an explicit top-level 'and' composition. Also review authorization logs for access granted to identities holding only weaker credentials (e.g., API keys) where administrator-level checks were expected.

Affected
Fastify (@fastify) @fastify/auth (npm)>=5.0.0 and <5.1.1 (5.0.0 through 5.1.0)
Estimated exposure
moderateroughly 10k–100k applications at most (≈200k weekly npm downloads for @fastify/auth, of which only a subset run versions 5.0.0–5.1.0 with run 'all' and nested… — Estimated from @fastify/auth's npm adoption (on the order of a few hundred thousand weekly downloads), scaled down for the narrow 5.0.0–5.1.0 version window and the specific 'or' + run 'all' with nested-array configuration required to…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

@fastify/auth is a Fastify plugin that composes multiple authentication and authorization strategies into a single route guard. In versions 5.0.0 through 5.1.0, when strategies are composed with the relation "or" option together with the run "all" option and one entry is a nested array acting as an AND group, the group is evaluated in an order-dependent way: an earlier failing check is silently dropped and the group's result becomes the outcome of its last check. As a result, a request that satisfies only the last member of an AND group, for example an attacker who holds a valid API key but is not an administrator, is authorized instead of rejected, and a related order-dependent bypass affects the mirror configuration where the top-level relation is "and" and a nested group uses "or". The issue is fixed in @fastify/auth 5.1.1, and users should upgrade to 5.1.1 or later. As a workaround, omit the run "all" option where it is not required, order each AND group so its stricter check is evaluated last, or replace nested AND groups with an explicit top-level "and" composition.

Weakness
CWE-285, CWE-697
Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

In the news

No ingested article mentions this CVE yet.