Vulnerability

Fastify Express Middleware Bypass (CVE-2026-112362)

A Critical middleware bypass in @fastify/express 4.0.5 through 4.0.8.

CVE ID
CVE-2026-112362
CVSS
9.1 Critical (CVSS v3.1, maintainer and OpenJS CNA)
Affected product
@fastify/express
Exploited
Unknown
Published
27 October 2026

In short

CVE-2026-112362 is a Critical middleware bypass in @fastify/express 4.0.5 through 4.0.8. An attacker can reach a scoped route without its Express auth checks when ignoreDuplicateSlashes is enabled. The maintainer rates it 9.1 and fixes it in 4.0.9. Check both the plugin version and router setting before judging exposure.

Profile MapVulnerability
  1. CVECVE-2026-112362
  2. ProductFastify @fastify/express
  3. Fix Steps4actions listedUpgrade the Plugin

What it allows

The plugin lets Express middleware run inside Fastify. The maintainer says a URL handling mismatch can let an unauthenticated attacker skip checks on a scoped path. These checks can include authentication, authorization, or rate limiting. The CVSS vector lists network access, low attack complexity, no privileges, and no user interaction.

Fastify and the Express layer can read the same request target in different ways. With ignoreDuplicateSlashes enabled, the plugin also collapses the scheme separator in an absolute-form target. Fastify still resolves the target to its path and runs the route handler. The Express layer no longer sees the scoped path, so its middleware does not run.

This is a route protection bypass, not a claim that every Fastify app is exposed. The advisory requires the non-default router option and an affected plugin release. A version check alone misses the setting that makes this path reachable. Review where each app enforces access checks.

For wider context, our developer security guide covers secure coding practice. See also our 2025 CWE Top 25 analysis and H1 2026 vulnerability exploitation trends.

For a different proxy access-control issue, see our Echo WebSocket route access bypass profile.

Who is affected

The affected npm package is @fastify/express, versions 4.0.5 through 4.0.8. The required setting is routerOptions.ignoreDuplicateSlashes: true. Its default is off. The maintainer lists 4.0.9 as the patched release and advises upgrading to 4.0.9 or later.

The scope is path-scoped Express middleware in the affected setup. The maintainer describes an admin route whose handler still runs while its auth middleware is skipped. It also names authorization and rate limiting as checks that can be bypassed. This does not establish code execution or observed attacks.

The advisory links the bug to the earlier @fastify/express bypass CVE-2026-33808. It says the fix for that issue introduced the affected normalization. It also points to CVE-2026-85184, a related absolute-form bypass in @fastify/middie. Those references do not change the affected package or fixed version for CVE-2026-112362.

Timeline

  1. 27 Oct 2026

    Fastify publishes GHSA-6h42-57hq-9746 with the affected versions, router condition, and 4.0.9 fix.

  2. 27 Oct 2026

    OpenJS publishes the CVE-2026-112362 record with the 9.1 Critical rating.

What to do

  1. Check Version and Router Setting

    Find @fastify/express in the deployed app and record its version. Check whether routerOptions.ignoreDuplicateSlashes is true. Review scoped Express middleware that guards sensitive handlers.

  2. Upgrade the Plugin

    Use @fastify/express 4.0.9 or later, as the maintainer advises. Test the app after the update and confirm the deployed build uses the fixed package. Keep the version evidence with the patch record.

  3. Use the Maintainer’s Workaround

    If the update must wait, leave ignoreDuplicateSlashes at its default, off. The maintainer also permits enforcing auth in a Fastify hook such as preHandler. That hook runs after the router resolves the request.

  4. Test Access Checks After the Change

    As a defensive check, verify that requests to protected routes still pass through the intended auth checks. Include paths guarded only by Express middleware. Treat this test as validation of your app, not proof of attacks.

Questions

Which Versions Fix CVE-2026-112362?

The maintainer lists @fastify/express 4.0.9 as patched and advises 4.0.9 or later. Versions 4.0.5 through 4.0.8 are affected when the non-default ignoreDuplicateSlashes option is enabled.

Is the Default Router Setting Affected?

The advisory requires ignoreDuplicateSlashes to be true. Its default is off. The maintainer lists leaving that default in place as one workaround; another is enforcing auth in a Fastify hook after routing.

Sources

  1. Fastify Express Middleware Bypass: GHSA-6h42-57hq-9746 Fastify
  2. CVE-2026-112362 Record CVE Program / OpenJS CNA