CVE-2026-112712: @fastify/middie path-scoped middleware bypass via scope prefix mismatch

CVE-2026-112712 · Severity: critical · CVSS 9.1 · Published 2026-10-20

@fastify/middie is the Express-style middleware engine for the Fastify web framework. When path-scoped middleware like authentication or authorization is registered with certain path patterns, a mismatch in how the plugin scope prefix and mount path are joined can cause the middleware to be silently skipped while the route handler still executes, allowing unauthenticated access to protected resources.

Technologies: Fastify @Fastify/Middie. Vendors: Fastify.

Quick answers

Is CVE-2026-112712 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-112712 being exploited in the wild.
How severe is CVE-2026-112712?
Critical severity, with a CVSS score of 9.1, published 20 October 2026.
Which products and versions are affected?
Fastify @Fastify/Middie 9.0.0 through 9.3.5.
Is there a fix for CVE-2026-112712?
Yes: fixed in @fastify/middie 9.3.6 or later. Until then: Enforce authorization in a Fastify hook such as preHandler that runs after the router has resolved the request. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-112712 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-112712?
Check whether you run Fastify @Fastify/Middie 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

  • Fixed in: @fastify/middie 9.3.6 or later

Enforce authorization in a Fastify hook such as preHandler that runs after the router has resolved the request.

Technical details

The vulnerability is a path normalization mismatch in @fastify/middie's use() function that occurs when scope prefixes end with a slash, array mount paths are used, or mount paths lack a leading slash. The middleware dispatcher joins paths differently than Fastify's router, causing authentication/authorization/rate-limiting middleware to fail to match while route handlers still execute. The attack requires only network access and no authentication; a single request can bypass the middleware silently.

Affected products

  • Fastify @fastify/middie 9.0.0 through 9.3.5

Timeline

  • 2026-10-20: disclosed

References

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