Skip to content

GHSA-p68q-wchp-6fh7 CVE-2026-76169

fastify vulnerable to authentication bypass via malformed URLs reaching encapsulated not-found handlers

High npm
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.53%
Chance of exploitation in the next 30 days. Higher than 44.86% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-288 Authentication Bypass Using an Alternate Path or Channel
Fix
5.12.2
Upgrade fastify to this version or later

Description

Impact

Fastify routes a malformed URL under one plugin prefix to the custom not-found handler of a different sibling plugin, invoking the handler registered last and skipping the preHandler declared in its setNotFoundHandler(). When the request method has no route in the main router, a malformed request target reaches Fastify's internal not-found router before URL decoding and is dispatched through a single shared handler pointer, regardless of prefix and without the normal request lifecycle. An unauthenticated request to a public prefix can therefore reach an authentication-protected not-found handler registered under a different prefix and receive its full response, breaking prefix encapsulation and bypassing the authentication hook. Applications whose private or tenant fallbacks return protected data from a not-found handler are affected.

Patches

Patched in fastify 5.12.2. Malformed URLs are now routed through the configured onBadUrl and onMaxParamLength handlers so they fail closed before any application not-found handler runs, and the shared not-found handler pointer has been removed.

Workarounds

Reject malformed request targets before they reach the application, for example at an upstream proxy or gateway, and do not rely on a not-found handler to serve protected data. A global onRequest authentication hook does not mitigate this, because the malformed-URL path skips it.

Affected versions

npm

PackageVulnerableFixed in
fastify
>= 4.0.0, < 5.12.2
5.12.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

fastify npm → 5.12.2

npm
npm install fastify@5.12.2
yarn
yarn add fastify@5.12.2
pnpm
pnpm add fastify@5.12.2

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Weakness

CWE-288: Authentication Bypass Using an Alternate Path or Channel

The product requires authentication, but the product has an alternate path or channel that does not require authentication.

How to prevent it
  • Architecture and Design: Funnel all access through a single choke point to simplify how users can access a resource. For every access, perform a check to determine if the user has permissions to access the resource.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-389g-gv7q-r4x8
fastify is vulnerable to header validation bypass via case-sensitive propertyNames
Low Also affects fastify
GHSA-4mh8-r7rc-xpvc
fastify vulnerable to Denial of Service via unhandled exception on HTTP/2 trailer responses
Medium Also affects fastify
GHSA-9q9j-q6p8-xq58
fastify vulnerable to header validation bypass via incomplete schema case normalization
High Also affects fastify
GHSA-667r-xxjv-c9mm
fastify vulnerable to request body replacement via an async validation result collision
High Also affects fastify
GHSA-hwr6-493r-vm6h
fastify vulnerable to request validation bypass via skipped boolean false schemas
High Also affects fastify
GHSA-w2qp-rph6-63g4
fastify vulnerable to schema validation bypass via root primitive coercion mismatch
Medium Also affects fastify
GHSA-3m5p-2c4r-xxw2
fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count
Medium Also affects fastify
GHSA-444r-cwp2-x5xf
fastify: request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections
Medium Also affects fastify
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor