Vulnerability in fastify (CVE-2026-16732)
Summary
Vulnerability in fastify (CVE-2026-16732). Confidential information can be exposed externally. Exploitable via request.host. Mitigation: upgrade to 5.12.1 or later.
Original description
The description as published by the source.
Impact
The fix for CVE-2026-3635 (GHSA-444r-cwp2-x5xf) added a proxyFn(socket.remoteAddress, 0) guard on the X-Forwarded-* reads in request.host, request.protocol, request.hostname, request.ip, and request.ips. That guard closes the IP, CIDR, and custom-function forms of trustProxy correctly because those forms compile to predicates that inspect the connecting address. The hop-count form (trustProxy: ) compiles to a predicate that structurally ignores the address argument, so the guard reduces to 0 < tp, always true for any tp >= 1.
Applications configured with trustProxy: (documented as "behind N reverse proxies", trustProxy: 1 being the canonical single-proxy setting) remain vulnerable. An attacker who can reach the Fastify origin directly, bypassing the front-facing proxy, can spoof the request fields exactly as in the unpatched version. Impact class matches the parent CVE-2026-3635: host injection in generated URLs, HTTPS-enforcement bypass, secure-cookie / CSRF-origin bypass, host-based routing and cache poisoning.
Patches
Patched in fastify 5.12.1. The numeric form of trustProxy is now disabled at runtime and removed from the TypeScript type union.
Workarounds
- Migrate to an IP / CIDR / custom-function
trustProxyvalue that validates the connecting address. Custom functions must inspect the `addres…
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-16732 has been found in fastify.
Attackers can target a specific entry point like request.host over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 6.1/10.
What to do: upgrade fastify to 5.12.1 or later.
If unsure, ask your IT team or search "fastify CVE-2026-16732" on the vendor's site.
CVE-2026-16732 (fastify) — CWE-348 / CVSS v3 6.1
Attack vector: adjacent-network / unauthenticated / no user interaction
Attack surface: request.host / request.protocol / request.hostname / request.ip
Patched: 5.12.1 — 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-348) exists in fastify. Attackers reach the vulnerable code path via request.host without authentication.
Check the vendor advisory for the affected versions of fastify. Attack surface: request.host / request.protocol / request.hostname / request.ip.
Severity: Medium (CVSS 6.1/10). Confidential information can be exposed externally.
Update to 5.12.1.
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' . 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' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
fastifyを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade fastify to 5.12.1ステージング環境で 5.12.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
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
- web github.com
- web github.com
- web github.com