CVE-2026-22037: fastify-express · Improper Handling of URL Encoding (Hex Encoding)
Affects fastify-expressSource CVE Database V5
Mentioned vulnerabilities
Not known to be exploited · CVSS 8.4 High : upgrade to 4.0.3 soon.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 28% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 4.0.3
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-25.
What to do
Upgrade fastify-express and @fastify/express to 4.0.3.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| fastifyfastify-express | Affected
| Fixed in
|
npm@fastify/expresspkg:npm/@fastify/expressOther 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 all instances of @fastify/express to version 4.0.3 or later immediately to apply the official patch addressing the URL encoding bypass. 2. Conduct a thorough audit of middleware path registrations to identify any sensitive routes protected by middleware that could be bypassed via encoded paths. 3. Implement additional request validation or normalization layers before middleware matching to decode and sanitize URL paths, ensuring consistent matching behavior. 4. Employ Web Application Firewalls (WAFs) with rules to detect and block suspicious URL-encoded requests targeting sensitive endpoints. 5. Monitor application logs for unusual access patterns involving encoded URLs that could indicate exploitation attempts. 6. Educate development teams about secure middleware configuration and the risks of relying solely on path-based middleware protections. 7. Consider defense-in-depth by enforcing authentication and authorization checks within route handlers themselves, not only in middleware. 8. Regularly update dependencies and monitor vulnerability disclosures related to Fastify and its plugins.
Description
The @fastify/express plugin adds full Express compatibility to Fastify. A security vulnerability exists in @fastify/express prior to version 4.0.3 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. The vulnerability is caused by how @fastify/express matches requests against registered middleware paths. This vulnerability is similar to, but differs from, CVE-2026-22031 because this is a different npm module with its own code. Version 4.0.3 of @fastify/express contains a patch fort the issue.