CVE-2026-22031: fastify middie · Improper Handling of URL Encoding (Hex Encoding)
Affects fastify middieSource CVE Database V5
Not known to be exploited · CVSS 8.4 High : upgrade to 9.1.0 soon.
Data as of 26 Oct 2026, 06:26 UTC
- 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:LExploitation evidence
Disclosed: evidence found.
CVE published 19 Jan 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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
| Product | Affected | Fixed in |
|---|---|---|
| fastifymiddie | Affected
| Fixed in
|
npm@fastify/middiepkg:npm/@fastify/middieOther threats | Affected
| Fixed in
|
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
- github.com/fastify/middie/security/advisories/GHSA-cxrg-g7r8-w69p (opens in a new tab)
- github.com/fastify/middie/pull/245 (opens in a new tab)
- github.com/fastify/middie/commit/d44cd56eb724490babf7b452fdbbdd37ea2effba (opens in a new tab)
- github.com/fastify/middie/releases/tag/v9.1.0 (opens in a new tab)