Skip to main content

@fastify/express CVE-2026-6556

| EUVDEUVD-2026-40309 CRITICAL
Improper Authorization (CWE-285)
2026-06-30 ce714d77-add3-4f53-aff5-83d477b104bb
9.1
CVSS 3.1 · Vendor: ce714d77-add3-4f53-aff5-83d477b104bb
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify prefixed route behind array/RegExp-mounted middleware
  2. Delivery
    Send unauthenticated request to prefixed path
  3. Exploit
    Fastify matches route but skips middleware
  4. Execution
    Access protected handler without authorization
  5. Impact
    Read or modify protected data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization verification
MITRE ATT&CK

1 technique across 1 tactic: Defense Evasion

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application uses @fastify/express (≤4.0.6) and registers path-scoped middleware - specifically middleware performing authentication, authorization, rate limiting, or auditing - inside a Fastify plugin that is mounted under a path prefix, AND that this middleware is declared with a non-string mount path (an array of paths or a regular expression) rather than a string. The route handler behind that middleware must also exist and be matchable by Fastify. What limits exploitation: applications that only use string mount paths, that do not prefix their plugins, or that enforce auth via Fastify hooks/route handlers instead of mounted middleware are not affected. No authentication is required of the attacker (PR:N) and no user interaction is needed; the gating factor is this specific, non-default middleware configuration choice by the application developer rather than any attacker-controlled condition.

Impact

The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N, base 9.1) describes a network-reachable, unauthenticated, low-complexity bypass with high confidentiality and integrity impact and no availability impact, which is consistent with an auth/authz control being skipped. However, the raw score overstates universal risk because exploitation is strictly conditional on application design: the targeted app must (a) use @fastify/express, (b) register security middleware in a prefixed plugin scope, and (c) mount that middleware with an array or RegExp path rather than a string. This is a real and serious bug for affected configurations but is not a blanket 'any deployment is exploitable' situation, which is why an independent assessment raises attack complexity. No EPSS score, KEV listing, POC, or SSVC decision data was supplied; absence of KEV means no confirmed active exploitation. Treat as high priority for teams that match the vulnerable pattern, and lower (but still patch-worthy) for those using only string mount paths.

Exploit ScenarioDerived

A developer protects /api/admin routes by registering an authentication middleware in a prefixed plugin using a RegExp or array mount path; because the prefix is never applied, the middleware never matches and is skipped. An unauthenticated attacker simply sends a normal HTTP request to the real prefixed route (e.g. GET /api/admin/users) and reaches the handler with no auth check enforced. No public exploit code is required given the low complexity, though none has been identified at time of analysis.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 30, 2026

Authorization bypass in the @fastify/express middleware-compatibility plugin (versions 4.0.6 and earlier) lets unauthenticated remote attackers reach protected routes inside prefixed Fastify plugin scopes when security middleware is mounted using array or regular-expression paths. Because those non-string mount paths are never rewritten with the plugin prefix, authentication, authorization, rate-limiting, or auditing middleware silently fails to match the real request path and is skipped while Fastify still routes the request to the handler. There is no public exploit identified at time of analysis, and the issue is fixed in 4.0.7.

RemediationAI

Vendor-released patch: 4.0.7 - upgrade @fastify/express to 4.0.7 or later, which restores prefix rewriting for non-string mount paths, per GHSA-3wf5-7852-vcfq (https://github.com/fastify/fastify-express/security/advisories/GHSA-3wf5-7852-vcfq). If an immediate upgrade is not possible, the vendor-documented workarounds are to convert every middleware mount path inside a prefixed plugin from an array or regular expression into a plain string path, or to register a separate individual use() call per path so each is a string; the trade-off is more verbose registration code and the need to audit every prefixed scope for array/RegExp usage, since any missed instance leaves the bypass open. As an interim compensating control, place the affected authentication/authorization checks at a layer that does not depend on the plugin's path rewriting (for example enforce them in the route handler or via Fastify hooks) until the upgrade is applied.

Affected VersionsENISA

@fastify/express 0 <4.0.7

Affected Packages

euvd fastify_express fix: 4.0.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

@fastify/express is the official Fastify plugin that runs Express-style middleware (app.use) inside Fastify, commonly used by teams migrating from Express or reusing Express ecosystem middleware. Fastify supports encapsulated plugin 'scopes' that can be registered under a path prefix; the plugin is responsible for rewriting middleware mount paths to include that prefix so middleware applies to the prefixed routes. The flaw is a CWE-285 Improper Authorization issue rooted in incomplete input handling: the prefix-rewrite logic only fires when the mount path argument is a string. When developers pass an array of paths or a RegExp (both valid Express mount-path forms), the prefix is not prepended, so the middleware's match pattern no longer corresponds to the actual prefixed URL Fastify dispatches, creating a gap between routing and policy enforcement.

Know when Fastify gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (ce714d77-add3-4f53-aff5-83d477b104bb) PRIMARY 9.1 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 7.4 HIGH

Network and unauthenticated (AV:N/PR:N), but AC:H because exploitation depends on the app using array/RegExp mount paths for security middleware in a prefixed scope; high C/I from bypassed authz, no availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (ce714d77-add3-4f53-aff5-83d477b104bb).

CVSS VectorVendor: ce714d77-add3-4f53-aff5-83d477b104bb

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

1
Patch available
Jun 30, 2026 - 15:01 EUVD

DescriptionCVE.org

@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.

Executive ViewAI

Why It Matters

Critical authorization bypass in @fastify/express plugin (versions 4.0.6 and earlier) enables unauthenticated remote attackers to circumvent security controls and access protected application routes, creating immediate risk of unauthorized data exposure and service compromise. No public exploit has been identified, but the vulnerability's nature and severity warrant immediate patching.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 77% exploitable
Prevalence
Medium
Fastify Express-compat plugin, moderate npm usage among migrating Node apps
Social Media
2
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

CVE-2023-31999 HIGH POC
8.8 Jul 04

All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all req

CVE-2021-22964 HIGH POC
8.8 Oct 14

A redirect vulnerability in the `fastify-static` module version >= 4.2.4 and < 4.4.1 allows remote attackers to redirect

CVE-2025-32442 HIGH POC
7.5 Apr 18

Fastify is a fast and low overhead web framework, for Node.js. Rated high severity (CVSS 7.5), this vulnerability is rem

CVE-2020-8136 HIGH POC
7.5 Mar 20

Prototype pollution vulnerability in fastify-multipart < 1.0.5 allows an attacker to crash fastify applications parsing

CVE-2018-3711 HIGH POC
7.5 Jun 07

Fastify node module before 0.38.0 is vulnerable to a denial-of-service attack by sending a request with "Content-Type: a

CVE-2020-8192 MEDIUM POC
6.5 Jul 30

A denial of service vulnerability exists in Fastify v2.14.1 and v3.0.0-rc.4 that allows a malicious user to trigger reso

CVE-2021-22963 MEDIUM POC
6.1 Oct 14

A redirect vulnerability in the fastify-static module version < 4.2.4 allows remote attackers to redirect users to arbit

CVE-2026-33808 CRITICAL
9.1 Apr 15

Authentication bypass in @fastify/express v4.0.4 and earlier allows remote unauthenticated attackers to access protected

CVE-2026-33807 CRITICAL
9.1 Apr 15

Middleware bypass in Fastify Express plugin (fastify/express) allows complete circumvention of authentication, authoriza

CVE-2022-41919 HIGH
8.8 Nov 22

Fastify is a web framework with minimal overhead and plugin architecture. Rated high severity (CVSS 8.8), this vulnerabi

CVE-2026-2880 HIGH
8.2 Feb 27

Authentication and authorization bypass in @fastify/middie (Node.js middleware library for Fastify) allows remote unauth

CVE-2026-84504 HIGH
8.1 Sep 04

Schema authorization bypass in Fastify before 5.12.2 allows an authenticated low-privilege attacker to substitute an arb

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy