Categories
CVE-2026-33807 critical CVSS 9.1

Vulnerability in @fastify/express (CVE-2026-33807)

Summary

Vulnerability in @fastify/express (CVE-2026-33807). Confidential information can be exposed externally. Exploitable via onRegister. Mitigation: upgrade to 4.0.5 or later.

Original description

The description as published by the source.

Summary

@fastify/express v4.0.4 contains a path handling bug in the onRegister function that causes middleware paths to be doubled when inherited by child plugins. This results in complete bypass of Express middleware security controls for all routes defined within child plugin scopes that share a prefix with parent-scoped middleware. No special configuration is required — this affects the default Fastify configuration.

Details

The vulnerability exists in the onRegister function at index.js lines 92-101. When a child plugin is registered with a prefix, the onRegister hook copies middleware from the parent scope and re-registers it using instance.use(...middleware). However, the middleware paths stored in kMiddlewares are already prefixed from their original registration.

The call flow demonstrates the problem:

  1. Parent scope registers middleware: app.use('/admin', authFn) — use() calculates path as '' + '/admin' = '/admin' — stores ['/admin', authFn] in kMiddlewares
  2. Child plugin registers with { prefix: '/admin' } — triggers onRegister(instance)
  3. onRegister copies parent middleware and calls instance.use('/admin', authFn) on child
  4. Child's use() function calculates path as '/admin' + '/admin' = '/admin/admin' — registers middleware with doubled path
  5. Routes in child scope use the child's Express instance, where middleware is registered under the incorrect path /admin/admin
  6. Requests to /admin/secret don't match `…

Source: NIST National Vulnerability Database NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-33807 has been found in @fastify/express.
Attackers can target a specific entry point like onRegister over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 9.1/10.
What to do: upgrade @fastify/express to 4.0.5 or later.
If unsure, ask your IT team or search "@fastify/express CVE-2026-33807" on the vendor's site.

CVE-2026-33807 (@fastify/express) — CWE-436 / CVSS v3 9.1
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: onRegister / index.js / kMiddlewares / this.prefix
Patched: 4.0.5 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-436) exists in @fastify/express. Attackers reach the vulnerable code path via onRegister without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of @fastify/express. Attack surface: onRegister / index.js / kMiddlewares / this.prefix.

🔥 Severity

Severity: Critical (CVSS 9.1/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 4.0.5.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r '@fastify/express' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r '@fastify/express' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で @fastify/express を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade @fastify/express to 4.0.5

    ステージング環境で 4.0.5 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

npm @fastify/express
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.0.5"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details