Résumé
fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count
Détails de l’avis
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: <number>) 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: <number> (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 theaddressargument, not only the hop index. - Ensure the Fastify origin is only reachable through the trusted proxy chain (no direct network path).
Références
- https://github.com/advisories/GHSA-3m5p-2c4r-xxw2
- https://github.com/fastify/fastify/security/advisories/GHSA-3m5p-2c4r-xxw2
- https://nvd.nist.gov/vuln/detail/CVE-2026-16732
- https://github.com/fastify/fastify/commit/8acfea7eada05383a7357e3eb21c2628416df280
- https://cna.openjsf.org/security-advisories.html
- https://github.com/fastify/fastify/releases/tag/v5.12.1
Vulnérabilités liées
Tout Supply chain →- MEDIUMCVE-2026-102275
PyJWT accepts inconsistent OKP x/d JWKs, causing public/private key identity confusion
- CRITICALCVE-2026-90711
proxy-addr vulnerable to IP spoofing via IPv4-mapped IPv6 trust subnet
- MEDIUMCVE-2026-62987
Fabio - Incomplete fix for CVE-2025-48865: operator-configured trust headers (clientip/tls/requestid) still strippable via the Connection header
- CRITICALCVE-2026-61682
kcp front-proxy does not strip inbound X-Remote-* identity headers, allowing any authenticated client to inject groups/warrants and impersonate system:masters in any workspace
- MEDIUMCVE-2026-61589
djust: WebSocket/runtime reconstructed request omits the client Host, causing host/subdomain TenantResolvers to misresolve the tenant on the live path
- HIGHCVE-2026-55641
9router: Unauthenticated `/v1` proxy access via `Host`-header spoofing → open AI relay + SSRF