Saltar al contenido
Fali Fuentes

Fastify: 5 critical bypasses in @fastify/express and @fastify/middie — update now

Leer este artículo en español

On November 20, 2026, the Fastify project published five vulnerabilities in GitHub Security Advisories affecting @fastify/express ≤ 4.0.9 and @fastify/middie ≤ 9.3.7. The corresponding CVEs (CVE-2026-133120, CVE-2026-124626, CVE-2026-133250, CVE-2026-132128, CVE-2026-132131) appeared in NVD and CVE.org between November 19 and 21. Most score CVSS 9.1 (Critical); CVE-2026-132128 has CVSS 7.4 per NVD. If you use any of these packages with authentication, authorization, or rate-limiting middleware mounted by route (path-scoped), a standard HTTP request lets you reach the handler without credentials or user interaction (AV:N/AC:L/PR:N/UI:N). Although the advisory is four days old, it remains urgent today because the definitive patches (@fastify/express 4.0.10 and @fastify/middie 9.3.8) were released on November 20 and 21, exploitation is trivial and requires no public PoC, and typical critical vulnerability SLAs (72 h) demand immediate deployment.

Root cause: router and compatibility layer desync

Fastify resolves the route with find-my-way, but @fastify/express and @fastify/middie perform their own matching on a different interpretation of the URL: different decoding, different normalization, different Unicode case folding, or matching against patterns with empty segments. The router dispatches to the handler while the Express/Middie middleware fails to match and skips the protection advisory GHSA-w877-hjcp-88rc.

Documented bypass vectors

  • Decoding/normalization (GHSA-w877-hjcp-88rc): three forms — backslash + space/# (e.g. /tenant/x%5C%20/admin), double decoding of %25 (e.g. /acct/%2561lice), and request-target starting with backslash (e.g. GET \admin) — cause Express to not match the mount while the handler still executes.
  • Unicode case folding (GHSA-6rmc-f24g-hmp6): with routerOptions.caseSensitive: false, find-my-way folds U+212A (KELVIN SIGN) to k via toLowerCase(); @fastify/express passes the route unfolded and Express uses a case-insensitive regex that does not fold non-ASCII. Result: /api/%E2%84%AAeys bypasses middleware on /api/keys.
  • Empty parameters/route (GHSA-662w-h4p6-jq4p): path-to-regexp (Express) requires a non-empty value in a dynamic segment; find-my-way accepts empty. GET /tenant/ or GET /files/ matches the handler but bypasses app.use('/tenant/:tenantId', authMiddleware).
  • @fastify/middie: three additional CVEs cover mismatches due to empty parameter/wildcard values, request-targets without a leading slash, and % literal in mount path (CVE-2026-133250, CVSS 9.1), does not honor caseSensitive of the router (CVE-2026-132128, CVSS 7.4), and normalization of mount paths in array that does not handle trailing slash or root path (CVE-2026-132131, CVSS unpublished).

Fixed versions and verification

@fastify/express 4.0.10 (published 2026-11-20) and @fastify/middie 9.3.8 (published 2026-11-21 per NVD) fixes all vectors. After updating, rebuild and redeploy container images, restart all Node.js processes, and verify at runtime with:

npm list @fastify/express @fastify/middie

Test each known vector: GET \admin, /tenant/x%5C%20/admin, /acct/%2561lice, /api/%E2%84%AAeys (with caseSensitive: false), GET /tenant/). Confirm that the security middleware runs (logs, metrics) and that legitimate requests keep working.

Temporary workarounds if you can’t deploy yet

These are provisional measures; they don’t cover all vectors (e.g., the Unicode case-folding bypass in middie requires disabling caseSensitive: false or updating).

  • Move authentication/authorization logic to a preHandler Fastify hook that runs after router resolution, basing the decision on request.routeOptions.url GHSA-w877-hjcp-88rc GHSA-662w-h4p6-jq4p.
  • Mount security middlewares on static parent routes (e.g. /tenant instead of /tenant/:tenantId) so empty segments don’t skip the mount GHSA-662w-h4p6-jq4p.
  • Block in onRequest (registered before @fastify/express) requests with a request-target starting with backslash or a path containing backslash GHSA-w877-hjcp-88rc.
  • Keep routerOptions.caseSensitive: true (it’s the default) to avoid the Unicode vector.

Supply chain and compliance

Audit package-lock.json, pnpm-lock.yaml or yarn.lock for embedded copies or transitive dependencies pulling old versions. Configure overrides / resolutions to force ≥ 4.0.10 and ≥ 9.3.8 across the entire tree. CVSS 9.1 on most CVEs mandates priority patching under frameworks like ISO 27001, NIST CSF, or internal critical vulnerability SLAs (e.g., 72 h). Notify development, platform, and security teams of the severity: trivial exploitation, no known public PoC but documented vectors. Record in your vulnerability inventory and follow the critical patching SLA.

Structured reference for readers and AI agents

{
  "format": "rafael-fuentes-article/1.0",
  "language": "en",
  "title": "Fastify: 5 critical bypasses in @fastify/express and @fastify/middie — update now",
  "summary": "Fastify disclosed five critical vulnerabilities (CVSS 9.1) that let attackers bypass route-scoped authentication middleware in @fastify/express ≤4.0.9 and @fastify/middie ≤9.3.7; upgrade to 4.0.10 and 9.3.8 immediately.",
  "author": "Rafael Fuentes",
  "publicationDate": "2026-11-24T06:01:16.036+01:00",
  "eventDate": "2026-11-20",
  "url": "https://falifuentes.com/rafael-fuentes-2026-11-24-am-en/",
  "translation": {
    "language": "es",
    "url": "https://falifuentes.com/rafael-fuentes-2026-11-24-am-es/"
  },
  "topics": [
    "Compliance and Regulations",
    "Cybersecurity",
    "Cybersecurity News",
    "English",
    "Supply Chain"
  ],
  "sources": [
    "https://nvd.nist.gov/vuln/detail/CVE-2026-133250",
    "https://github.com/fastify/fastify-express/security/advisories/GHSA-w877-hjcp-88rc",
    "https://github.com/fastify/fastify-express/security/advisories/GHSA-6rmc-f24g-hmp6",
    "https://nvd.nist.gov/vuln/detail/CVE-2026-132131",
    "https://nvd.nist.gov/vuln/detail/CVE-2026-132128",
    "https://github.com/fastify/fastify-express/security/advisories/GHSA-662w-h4p6-jq4p"
  ]
}
SYSTEM_EXPERT
Rafael Fuentes – BIO

I am a seasoned cybersecurity expert with over twenty years of experience leading strategic projects in the industry. Throughout my career, I have specialized in comprehensive cybersecurity risk management, advanced data protection, and effective incident response. I hold a certification in Industrial Cybersecurity, which has provided me with deep expertise in compliance with critical cybersecurity regulations and standards. My experience includes the implementation of robust security policies tailored to the specific needs of each organization, ensuring a secure and resilient digital environment.

Share
Scroll al inicio