{"id":"CVE-2026-16732","published":"2026-08-18T20:30:22Z","modified":"2026-08-19T13:16:06Z","title":"fastify vulnerable to X-Forwarded-* spoofing under trustProxy hop-count","vendor":"fastify","product":"fastify","tier":"tail","description":{"text":"fastify is a fast and low overhead web framework for Node.js. Impact: the fix for CVE-2026-3635 added a guard on the forwarded-header reads used to derive the request host, protocol, hostname, ip, and ips values, checking the connecting address. 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, where trustProxy is set to a number, compiles to a predicate that structurally ignores the address, so the guard is always satisfied for any hop count of one or more. Applications configured with a numeric trustProxy value, such as trustProxy set to 1 for a single reverse proxy, remain vulnerable: an attacker who can reach the Fastify origin directly, bypassing the front-facing proxy, can spoof the forwarded request fields exactly as in the unpatched version. The impact class matches the parent CVE-2026-3635, including host injection in generated URLs, HTTPS-enforcement bypass, secure-cookie and CSRF-origin bypass, and host-based routing and cache poisoning. Affected versions are fastify from 5.8.3 up to but not including 5.12.1. Patches: patched in fastify 5.12.1, where the numeric form of trustProxy is disabled at runtime and removed from the TypeScript type union. Workarounds: migrate to an IP, CIDR, or custom-function trustProxy value that validates the connecting address, and ensure the Fastify origin is only reachable through the trusted proxy chain.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.1,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00158,"percentile":0.05046,"provenance":"source"},"cwes":[{"id":"CWE-348","name":"Use of Less Trusted Source"}],"references":[{"url":"https://github.com/fastify/fastify/security/advisories/GHSA-3m5p-2c4r-xxw2","tags":[]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":[]}],"priority":{"score":5.3,"factors":[{"name":"EPSS percentile","points":1.01},{"name":"CVSS severity","points":4.27}]},"vendorSlug":"fastify","affectedVersions":[{"vendor":"fastify","product":"fastify","versions":[">= 5.8.3, < 5.12.1"]}],"fixedVersions":[{"vendor":"fastify","product":"fastify","versions":["5.12.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-08-19T13:15:46.091425Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"fastify","vulnerableRanges":[">=5.8.3, <5.12.1"],"patched":["5.12.1"],"from":["GHSA-3m5p-2c4r-xxw2"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-61222","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-3419","published":"2026-03-06","fixed":"5.8.1","kev":false},{"cve":"CVE-2026-3635","published":"2026-03-23","fixed":"5.8.3","kev":false},{"cve":"CVE-2026-33806","published":"2026-04-15","fixed":"5.8.5","kev":false,"link":{"from":"CVE-2026-33806","to":"CVE-2026-16732","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:fastify","fromFixed":"5.8.5","toFixed":"5.12.1","daysApart":125}]}},{"cve":"CVE-2026-16732","published":"2026-08-18","fixed":"5.12.1","kev":false},{"cve":"CVE-2026-18504","published":"2026-08-18","fixed":"5.12.1","kev":false},{"cve":"CVE-2026-76169","published":"2026-09-04","fixed":"5.12.2","kev":false},{"cve":"CVE-2026-84428","published":"2026-09-04","fixed":"5.12.2","kev":false}],"package":"npm:fastify"}}