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:
- Parent scope registers middleware:
app.use('/admin', authFn)—use()calculates path as'' + '/admin' = '/admin'— stores['/admin', authFn]inkMiddlewares - Child plugin registers with
{ prefix: '/admin' }— triggersonRegister(instance) onRegistercopies parent middleware and callsinstance.use('/admin', authFn)on child- Child's
use()function calculates path as'/admin' + '/admin' = '/admin/admin'— registers middleware with doubled path - Routes in child scope use the child's Express instance, where middleware is registered under the incorrect path
/admin/admin - Requests to
/admin/secretdon'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.
A vulnerability (CWE-436) exists in @fastify/express. Attackers reach the vulnerable code path via onRegister without authentication.
Check the vendor advisory for the affected versions of @fastify/express. Attack surface: onRegister / index.js / kMiddlewares / this.prefix.
Severity: Critical (CVSS 9.1/10). Confidential information can be exposed externally.
Update to 4.0.5.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
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
-
1Identify exposure identify
grep -r '@fastify/express' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
@fastify/expressを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade @fastify/express to 4.0.5ステージング環境で 4.0.5 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web cna.openjsf.org
- web github.com