Security Resilience

CVE-2026-22031

Fastify\/Middie ≤ 9.1.0

Public PoC
Published
19 January 2026
Modified
14 May 2026
Patch / advisory
CVSS Score v3.1 8.4
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L
EPSS Score 0.0090 58th percentile
Risk Priority 60 floored blend · peak EPSS

CVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). EPSS, Forum of Incident Response and Security Teams (FIRST), epss.first.org. Risk Priority is our own derived reading, not an NVD score.

Summary

CVE-2026-22031 is a high-severity Hex Encoding (CWE-177) vulnerability in Fastify\/Middie. Its CVSS base score is 8.4 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Application or System Exploitation (T1499.004); ranked in the top 42% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2026-22031 is a security vulnerability in the @fastify/middie plugin, which provides enhanced middleware support for the Fastify web framework. Affecting versions prior to 9.1.0, the issue stems from the middleware engine's failure to properly handle URL-encoded characters in path prefixes. For example, a path like `/admin` protected by middleware can be bypassed by sending an encoded variant such as `/%61dmin`, where `%61` decodes to `a`. While the middleware skips execution due to a path mismatch, Fastify's underlying router decodes the path correctly and proceeds to match and execute the route handler.

An attacker with low privileges (PR:L) can exploit this over the network (AV:N) without user interaction (UI:N), though it requires high attack complexity (AC:H) due to the need for precise encoding. Successful exploitation allows bypassing middleware constraints, such as authentication or authorization checks, on protected endpoints. This grants high confidentiality and integrity impacts (C:H/I:H) with low availability impact (A:L), and the scope changes (S:C) to affect the Fastify router component.

Mitigation is available via upgrade to version 9.1.0 of @fastify/middie, which addresses the path matching issue. Relevant advisories and fixes are detailed in the GitHub security advisory (GHSA-cxrg-g7r8-w69p), pull request #245, commit d44cd56eb724490babf7b452fdbbdd37ea2effba, and the v9.1.0 release notes. The vulnerability is classified under CWE-177 (Incorrect Behavior Order: Early Validation) with a CVSS v3.1 base score of 8.4.

EU & UK References

Vulnerability Data

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

more

`/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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

MITRE ATT&CK v20.0

T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
T1499 Endpoint Denial of Service Impact
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-14181Same product: Fastify Fastify\/Middie
CVE-2026-2880Same product: Fastify Fastify\/Middie
CVE-2026-6414Same vendor: Fastify
CVE-2026-33804Same product: Fastify Fastify\/Middie
CVE-2026-85184Same product: Fastify Fastify\/Middie
CVE-2026-6270Same product: Fastify Fastify\/Middie
CVE-2026-14198Same product: Fastify Fastify\/Middie
CVE-2026-59083Shared CWE-177
CVE-2024-48866Shared CWE-177
CVE-2026-41041Shared CWE-177

Affected Assets

fastify
fastify\/middie
≤ 9.1.0

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

—

Detect
Catch it (NIST detect / respond)

—

Harden
Shrink the surface (DISA STIG)

—

Validate
Prove the fix (OWASP ASVS)
  • V1.2.2

Mitigating Controls (NIST 800-53 r5)

Our mappings, made for this CVE.

Proper input validation requires decoding and checking URL-encoded data before use, directly stopping the weakness from being exploitable.

Mitigating Controls (NIST CSF 2.0)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→CSF cross-walk — links open the control.

PR.PS-06 mostly match
blocks

Secure SDLC practices directly require correct URL-encoding/decoding and input validation during development.

Mitigating Controls (ISO/IEC 27001:2022 Annex A)

Our mappings, derived directly from the weakness types (CWEs) cited in the NVD entry via our CWE→ISO cross-walk — links open the control.

finds

Security testing in development catches URL-decoding flaws before release, but does not itself define coding rules.

prevents

Training developers on URL encoding handling reduces but does not eliminate instances of this implementation defect, mirroring the A.6.3 vs CWE-598 anchor where educated developers help but are fallible.

prevents

Secure coding standards mandate proper handling and decoding of encoded inputs, eliminating CWE-177.

prevents

A.8.30 carries its effect through the secure-development practices its contract requires of the supplier (8.25 to 8.29), so it reduces ordinary software implementation weaknesses like CWE-177 in delivered code the way those practices do, at `partial`; the clause sits at its declared ceiling on this verb.

blocks

A.8.8 identifies, evaluates, and patches technical vulnerabilities but does not intercept or neutralize a URL-encoded attack payload in flight, so the weakness remains exploitable.

References