CVE-2026-22037: Fastify @fastify/express middleware bypass via URL encoding

CVE-2026-22037 · Severity: low · CVSS 3.1 · Published 2026-01-20

@fastify/express is a popular middleware adapter that brings Express-style middleware support to Fastify applications. The vulnerability allows attackers to bypass middleware security protections (such as authentication checks) by using URL-encoded path characters. An attacker can access restricted endpoints like /admin by requesting encoded variations like /%61dmin, bypassing the middleware entirely while still reaching the intended route handler.

Technologies: @fastify/express (npm). Vendors: npm.

Quick answers

Is CVE-2026-22037 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-22037 being exploited in the wild.
How severe is CVE-2026-22037?
Low severity, with a CVSS score of 3.1, published 20 January 2026.
Which products and versions are affected?
@fastify/express (npm) SEMVER:introduced=0,fixed=4.0.3.
Is there a fix for CVE-2026-22037?
Yes. @fastify/express (npm): upgrade to 4.0.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-22037 attacked?
It is attacked over the network.
Am I affected by CVE-2026-22037?
Check whether you run @fastify/express (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @fastify/express (npm): upgrade to 4.0.3 or later
    npm install @fastify/express@4.0.3

Technical details

The vulnerability is a middleware bypass caused by inconsistent URL path handling between the @fastify/express middleware matching engine and the underlying Fastify router. When a request arrives with a URL-encoded path (e.g., /%61dmin for /admin), the middleware engine fails to match the encoded path against registered middleware prefixes and skips execution. However, the Fastify router downstream correctly decodes the URL and matches the route handler, allowing the request to reach protected endpoints without passing through blocking middleware. The attack requires low privileges and works over the network with moderate attack complexity. Patches are available in version 4.0.3 and later.

Affected products

  • Fastify @fastify/express <= 4.0.2

Identifiers

  • CVE-2026-22037
  • GHSA-g6q3-96cp-5r5m

Timeline

  • 2026-01-19: disclosed: NVD publication date
  • 2026-01-20: disclosed: GitHub advisory GHSA-g6q3-96cp-5r5m published
  • 2026-01-20: patched: Version 4.0.3 released with fix

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.