CVE-2026-64785: swift-nio-http2: Missing CR/LF/NUL validation in header values
Summary SwiftNIO HTTP/2 was missing validation on inbound HEADERS frames that let CR, LF, NUL, SP and other control characters reach an HTTP/1.1 backend through NIOHTTP2's HTTP/2-to-HTTP/1 codec, enabling HTTP request smuggling or response splitting.
Published Jul 24, 2026
Affected packages
swift-nio-http2
- Ecosystem
- Swift
- Affected
- < 1.45.0
- Fixed in
- 1.45.0
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
SwiftNIO HTTP/2 was missing validation on inbound HEADERS frames that let CR, LF, NUL, SP and other control characters reach an HTTP/1.1 backend through NIOHTTP2's HTTP/2-to-HTTP/1 codec, enabling HTTP request smuggling or response splitting.
Impact
Two related gaps in inbound header validation, against any application using HTTP2ToHTTP1Codec (or HTTP2FramePayloadToHTTP1Codec) to front an HTTP/1.1 backend:
Regular header field values were only checked against a forbidden-name list (connection, transfer-encoding, proxy-connection, keep-alive, upgrade); the value itself was never inspected. An attacker-controlled regular header field value containing CR or LF passed validation and, once serialized as name: value CRLF by the codec, terminated the field early and injected extra header lines into the outbound HTTP/1.1 message.
Pseudo-header values (:path in particular) were only checked against CR, LF and NUL. A :path value containing SP serializes into the request-target of METHOD SP request-target SP HTTP-version CRLF, so a value like /a HTTP/1.1 produces GET /a HTTP/1.1 HTTP/1.1 — a parser-differential request line depending on whether a downstream reader takes the first or last SP-delimited token as the version.
Neither of these is reachable on a stock pipeline: NIOHTTP1's outbound validator (enableOutboundHeaderValidation, on by default) already rejects these characters on write. The exposure is pipelines that skip outbound validation, or any code that reads validated-looking HTTPRequestHead.headers and forwards the values on trusting that HTTP/2 already checked them.
Fix
Fixed in 48bfd90 and 45bdf67.
Mitigation
Upgrade to 1.45.0
Credited to sour-exploit.
References
- https://github.com/apple/swift-nio-http2/security/advisories/GHSA-q3g2-m552-3r9c
- https://nvd.nist.gov/vuln/detail/CVE-2026-64785
- https://github.com/apple/swift-nio-http2/commit/45bdf670248be5f16ec0340e125dca285536f0fb
- https://github.com/apple/swift-nio-http2/commit/48bfd9067d7d1d15c4789440127a0cf36222ea43
- https://github.com/apple/swift-nio-http2/releases/tag/1.45.0
- https://github.com/advisories/GHSA-q3g2-m552-3r9c
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
