CVE-2026-6556
Undergoing Analysis Undergoing Analysis - In Progress

Path Bypass in Fastify Express Plugin

Vulnerability report for CVE-2026-6556, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-30

Last updated on: 2026-06-30

Assigner: openjs

Description

@fastify/express versions 4.0.6 and earlier only rewrite the plugin prefix for middleware mount paths when the path argument is a string. Non-string mount paths (arrays of paths and regular expressions) are left unprefixed inside prefixed plugin scopes, so middleware registered with those forms does not match the actual prefixed request path. Applications that use path-scoped middleware for authentication, authorization, rate limiting, or auditing on routes inside a prefixed scope can be bypassed by sending a request to the prefixed route, because Fastify still matches the route but the middleware is skipped. Patches: upgrade to @fastify/express 4.0.7. Workarounds: use string mount paths instead of arrays or regular expressions in prefixed plugins, or register one use call per path.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-06-30
Last Modified
2026-06-30
Generated
2026-06-30
AI Q&A
2026-06-30
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
fastify express to 4.0.7 (exc)
fastify express 4.0.7

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-285 The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

The vulnerability in @fastify/express versions 4.0.6 and earlier involves how middleware mount paths are handled inside prefixed plugins. Specifically, when the mount path is not a string (for example, an array of paths or a regular expression), the plugin prefix is not correctly applied. This means that middleware registered with these non-string paths does not match the actual prefixed request path, causing the middleware to be skipped.

As a result, middleware that is supposed to handle authentication, authorization, rate limiting, or auditing on routes inside a prefixed scope can be bypassed by sending requests to the prefixed routes, because Fastify matches the route but the middleware does not run.

The issue is fixed in version 4.0.7 by properly rewriting the plugin prefix for all mount path types. Workarounds include using only string mount paths or registering separate middleware calls for each path.

Impact Analysis

This vulnerability can have a critical impact on your application security. Because middleware responsible for authentication, authorization, rate limiting, or auditing can be bypassed, unauthorized users may gain access to protected routes or resources.

This can lead to unauthorized data access, privilege escalation, and potential compromise of sensitive information or application integrity.

The CVSS score of 9.1 reflects the high severity of this issue, indicating a high impact on confidentiality and integrity without requiring user interaction or privileges.

Detection Guidance

Detection of this vulnerability involves identifying if your application uses @fastify/express version 4.0.6 or earlier and if it employs non-string mount paths (arrays or regular expressions) in prefixed plugins for middleware.

You can check the installed package version by running the following command in your project directory:

  • npm list @fastify/express

To detect if non-string mount paths are used in your codebase, you can search for middleware registration patterns using arrays or regular expressions. For example, using grep:

  • grep -r "use([\[\]/" ./

Additionally, monitoring network traffic for requests that bypass authentication or authorization middleware on prefixed routes may indicate exploitation attempts, but specific commands for this are not provided in the available resources.

Mitigation Strategies

The primary mitigation step is to upgrade the @fastify/express package to version 4.0.7 or later, where this vulnerability is patched.

If upgrading immediately is not possible, apply the following workarounds:

  • Use string mount paths instead of arrays or regular expressions in prefixed plugins.
  • Register one use() call per path rather than using arrays or RegExp.
Compliance Impact

This vulnerability allows middleware responsible for authentication, authorization, rate limiting, or auditing to be bypassed when non-string mount paths are used in prefixed Fastify plugins. As a result, protected routes may be accessed without proper authorization, potentially exposing sensitive data or functionality.

Such unauthorized access can lead to violations of compliance requirements in standards and regulations like GDPR and HIPAA, which mandate strict controls over access to personal and sensitive data, as well as proper auditing and authorization mechanisms.

Therefore, applications affected by this vulnerability may fail to meet these regulatory requirements until patched or mitigated.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-6556. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart