Skip to main content
CVE-2026-22031VulnerabilityPublished

CVE-2026-22031: fastify middie · Improper Handling of URL Encoding (Hex Encoding)

Affects fastify middieSource CVE Database V5

0

Not known to be exploited · CVSS 8.4 High : upgrade to 9.1.0 soon.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 3.1 base score
8.4High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.5% chance of exploitation in 30 days – higher than 44% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 9.1.0
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 19 Jan 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.

What to do

Upgrade middie and @fastify/middie to 9.1.0.

Affected software

ProductAffectedFixed in
fastifymiddieAffected
  • <9.1.0
Fixed in
  • 9.1.0
npm@fastify/middiepkg:npm/@fastify/middieOther threatsAffected
  • <9.1.0
Fixed in
  • 9.1.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

1. Upgrade @fastify/middie to version 9.1.0 or later immediately to apply the fix for this vulnerability. 2. Audit all Fastify applications to identify usage of @fastify/middie and verify middleware path prefixes for potential bypass. 3. Implement additional server-side validation and access controls at the route handler level to reduce reliance solely on middleware for critical security functions. 4. Employ Web Application Firewalls (WAFs) with rules to detect and block suspicious URL-encoded requests targeting sensitive paths. 5. Monitor application logs for unusual access patterns involving URL-encoded paths that could indicate exploitation attempts. 6. Conduct security testing including fuzzing and penetration testing focusing on URL encoding edge cases to uncover similar issues. 7. Educate development teams on secure middleware usage and the importance of consistent URL decoding in all request processing layers. 8. Maintain an inventory of all web applications using Fastify and middleware plugins to ensure timely patch management.

Description

CVE-2026-22031 is a high-severity vulnerability in the @fastify/middie plugin prior to version 9.1.0 that allows bypassing middleware protections via URL-encoded path prefixes. The middleware fails to decode URL-encoded characters when matching paths, while Fastify's router correctly decodes them, enabling attackers to access protected routes without middleware enforcement. This can lead to unauthorized access, compromising confidentiality and integrity of applications using vulnerable versions. The vulnerability requires network access and low privileges but no user interaction. Although no known exploits are reported, the impact on affected systems is significant. Upgrading to version 9.1.0 or later mitigates the issue.

References

Community reviews

Loading reviews…