CVE-2026-107832: fastify vulnerable to header validation bypass via case-sensitive propertyNames
fastify is a fast and low overhead web framework for Node.js. In versions 5.12.2 through 5.12.5, the routine that lowercases header names declared in a route schema does not lowercase the enum or const header names nested inside a propertyNames subschema. As a result, a header allow-list or deny-list written with canonical (non-lowercase) casing never matches the incoming lowercased header, so a restricted header passes validation and reaches the route handler. An attacker can therefore bypass a case-sensitive header validation rule and smuggle a forbidden header past the schema, affecting the integrity of request handling. The issue is fixed in fastify 5.12.6, and users should upgrade to 5.12.6 or later. There is no workaround other than upgrading, though applications can declare header names in lowercase to avoid the mismatch.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
fastifyto a version that resolves this vulnerability.Fixed in 5.12.6 - Configuration
Declare header names in lowercase to avoid the case-sensitive validation mismatch.
fastify route schema header names in enum or const propertyNames = lowercase
Event History
Frequently Asked Questions
Which applications are exposed to this bypass?
Applications using Fastify versions 5.12.2 through 5.12.5 are affected when a route schema uses a propertyNames subschema with enum or const values to allow-list or deny-list request headers using non-lowercase header names. The bypass matters only where the route handler relies on that validation to restrict headers.
What does an attacker need to exploit the issue?
An attacker needs to send a request to an affected route with a header that the application intends to restrict through the affected case-sensitive propertyNames validation rule. No authentication or user interaction is required, but the schema must contain the vulnerable non-lowercase enum or const header declaration.
How can teams mitigate the issue if they cannot immediately upgrade?
There is no complete workaround other than upgrading to Fastify 5.12.6 or later. As a temporary mitigation, declare header names in lowercase in the affected propertyNames enum or const schema values.
How can I determine whether an existing schema is vulnerable?
Review route header schemas for propertyNames subschemas containing enum or const values. If those values name headers with canonical or other non-lowercase casing, validation may fail to match the incoming lowercased header and allow it through.