{"id":"HSEC-2026-0015","summary":"Missing validation of CONNECT requests in http2","details":"# Missing validation of CONNECT requests in http2\n\nFor CONNECT requests, `checkRequestHeader` (`Network/HTTP2/H2/HPACK.hs`) in http2 up to 5.4.13 returned early, only requiring the absence of `:scheme` and `:path`. Every other check was skipped:\n\n* the requirement that `:authority` is present (RFC 9113, Section 8.5);\n* the check that `:authority` and `Host` agree, which applies to every other request (RFC 9113, Section 8.3.1: a server SHOULD treat a mismatch as malformed);\n* the common checks for `:status`, `Connection` and `TE`.\n\nA CONNECT request carrying `:authority: a.example` and `Host: b.example` was therefore accepted. Consumers that read `Host` see `b.example` where intermediaries that read `:authority` see `a.example`. warp, for example, sets `requestHeaderHost` to `Host` when present and falls back to `:authority`, so an application behind an intermediary that routes or authorizes on `:authority` handles a request other than the one the intermediary validated — a request can be smuggled past the front-end's access control, validation, logging or WAF rules.\n\nExploitation requires a front-end that makes decisions based on `:authority` while the application behind it bases routing or authorization on `Host`; a directly exposed server sees only one authority.\n\nA CONNECT request with neither `:authority` nor `:path` also passed validation and reached warp 3.4.21, where `fromJust (mPath \u003c|\u003e mAuth)` (`Network/Wai/Handler/Warp/HTTP2/Request.hs`) threw. The exception was raised in the stream's worker thread, so it reset one stream and did not affect the server process.\n\n## Resolution\n\nhttp2 5.4.14 validates CONNECT requests like every other request: `:authority` is required, `:scheme` and `:path` are forbidden, and the common checks apply, including the `:authority`/`Host` consistency check. A malformed request is rejected with a stream error of type `PROTOCOL_ERROR`, leaving the connection itself in place. With every request thus carrying `:path` or `:authority` when it reaches warp, the `fromJust` can no longer fail, so warp needs no change.\n\nThe same release also stops the server from pushing on a request that has no `:scheme` or `:authority`, where a push previously crashed on the missing `:scheme`.\n\nUpgrade to http2 5.4.14 or later. Series before 4.0 performed no `:authority`/`Host` consistency check at all, for any request, and are unsupported; upgrade regardless.\n\n## Credits\n\nReported by Akash Sebastian (@akashseb). Validated and fixed by Kazu Yamamoto.\n","modified":"2026-11-16T02:30:02.885790968Z","published":"2026-11-16T02:22:07Z","database_specific":{"home":"https://github.com/haskell/security-advisories","osvs":"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export","repository":"https://github.com/haskell/security-advisories"},"references":[{"type":"FIX","url":"https://github.com/kazu-yamamoto/http2/commit/7c119b5890fefa6a00a2c389fb85f15d4b683a60"},{"type":"FIX","url":"https://github.com/kazu-yamamoto/http2/commit/da1453d3be3277b4b5efba63b97c7a21d32d4e96"},{"type":"PACKAGE","url":"https://hackage.haskell.org/package/http2"}],"affected":[{"package":{"name":"http2","ecosystem":"Hackage","purl":"pkg:hackage/http2"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"5.4.14"}]}],"versions":["4.0.0","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.2.0","4.2.1","4.2.2","5.0.0","5.0.1","5.1.0","5.1.1","5.1.2","5.1.3","5.1.4","5.2.0","5.2.1","5.2.2","5.2.3","5.2.4","5.2.5","5.2.6","5.3.0","5.3.1","5.3.10","5.3.11","5.3.2","5.3.3","5.3.4","5.3.5","5.3.6","5.3.7","5.3.8","5.3.9","5.4.0","5.4.1","5.4.10","5.4.11","5.4.12","5.4.13","5.4.2","5.4.3","5.4.4","5.4.5","5.4.6","5.4.7","5.4.8","5.4.9"],"database_specific":{"source":"https://github.com/haskell/security-advisories/blob/generated/osv-export/2026/HSEC-2026-0015.json","human_link":"https://github.com/haskell/security-advisories/tree/main/advisories/published/2026/HSEC-2026-0015.md","osv":"https://raw.githubusercontent.com/haskell/security-advisories/refs/heads/generated/osv-export/2026/HSEC-2026-0015.json"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N"}]}],"schema_version":"1.9.2"}