LiveActive security incident?Get immediate response
CVE Record

CVE-2026-22031: Fastify Middie Middleware Path Bypass

@fastify/middie is the plugin that adds middleware support on steroids to Fastify. A security vulnerability exists in @fastify/middie prior to version 9.1.0 where middleware registered with a specific path prefix can be bypassed using URL-encoded characters (e.g., `/%61dmin` instead of `/admin`). While the middleware engine fails to match the encoded path and skips execution, the underlying Fastify router correctly decodes the path and matches the route handler, allowing attackers to access protected endpoints without the middleware constraints. Version 9.1.0 fixes the issue.

HighCVSS 8.4Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Fastify applications using @fastify/middie before 9.1.0 may fail to run path-specific middleware when a request uses URL-encoded characters. If that middleware enforces authentication or other controls, protected routes could be reached without those checks. The vendor fixed this in 9.1.0.

Executive priority

Treat as a high-priority application dependency update for Fastify services protecting routes with middleware. Business urgency is highest for externally reachable APIs and admin endpoints. No active exploitation evidence is provided, but the impact can include bypassing intended access controls.

Technical view

@fastify/middie matched middleware prefixes against an encoded path, while Fastify routing decoded the path before selecting a handler. This mismatch lets encoded path variants bypass middleware registered for a specific prefix. The CVE lists CVSS 8.4, CWE-177, affected versions before 9.1.0, and a fix in 9.1.0.

Likely exposure

Exposure is likely limited to Node.js Fastify services that use @fastify/middie versions below 9.1.0 and rely on path-prefix middleware for security checks, logging, rate limits, or request constraints.

Exploitation context

The CVSS vector indicates network reachability, low privileges, no user interaction, high attack complexity, and possible confidentiality and integrity impact. The source bundle does not show CISA KEV listing or cited evidence of active exploitation.

Researcher notes

Focus analysis on path normalization differences between middleware matching and Fastify route matching. The advisory states encoded paths can skip middleware while still reaching decoded route handlers. Do not assume all Fastify apps are affected; exposure depends on @fastify/middie usage and security reliance on prefixed middleware.

Mitigation direction

  • Upgrade @fastify/middie to version 9.1.0 or later.
  • Prioritize services where prefix middleware enforces authentication or authorization.
  • Review vendor advisory and release notes for any additional guidance.
  • Redeploy and restart affected services after dependency updates.
  • Check transitive dependency paths that may include vulnerable @fastify/middie versions.

Validation and detection

  • Inventory Fastify applications and dependency manifests for @fastify/middie versions below 9.1.0.
  • Identify middleware registered with specific path prefixes.
  • Confirm security-critical middleware still executes for encoded path variants in staging.
  • Verify production builds use @fastify/middie 9.1.0 or later.
  • Review access logs for unusual encoded requests to protected route prefixes.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-177: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-22031 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.4 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.4CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L1.86Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

8.4High
CVSS 3.1 vector shape for CVE-2026-22031Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
fastifymiddie< 9.1.0Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-177 · source CWE mapping

Improper Handling of URL Encoding (Hex Encoding)

Improper Handling of URL Encoding (Hex Encoding) represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.