Skip to content

fix(http2): delete malformed framing-related headers from responses - #548

Open
duongynhi000005-oss wants to merge 1 commit into
imroc:masterfrom
duongynhi000005-oss:fix/http2-delete-malformed-framing-headers
Open

duongynhi000005-oss wants to merge 1 commit into
imroc:masterfrom
duongynhi000005-oss:fix/http2-delete-malformed-framing-headers

Conversation

@duongynhi000005-oss

Copy link
Copy Markdown

Description

This PR synchronizes the upstream Go security fix for CVE-2026-78660 (ffc306b) into the inlined HTTP/2 transport (internal/http2/transport.go).

What this fixes

  1. Strip Connection-Specific Headers: In HTTP/2 responses, headers such as Connection, Keep-Alive, Proxy-Connection, Transfer-Encoding, and Upgrade are connection-specific and prohibited by RFC 9113 §8.2.2. If forwarded by a client/reverse-proxy to an HTTP/1 endpoint, they could lead to response smuggling. These are now stripped from incoming response headers.
  2. Strict Content-Length Validation: Multiple conflicting or unparseable Content-Length headers are now deleted (setting ContentLength = -1), while identical duplicate Content-Length headers are collapsed into a single value per RFC 9110 §8.6.
  3. Unit Tests: Added transport_response_test.go verifying that connection headers are purged and malformed/conflicting Content-Length values are cleanly dropped.

Fixes #542

Signed-off-by: duongynhi000005-oss duongynhi000005@gmail.com

Sync upstream Go CVE-2026-78660 fix (commit ffc306b):
- Strip connection-specific headers (Connection, Keep-Alive, Proxy-Connection, Transfer-Encoding, Upgrade) from HTTP/2 responses per RFC 9113 §8.2.2.
- Collapse identical duplicate Content-Length headers per RFC 9110 §8.6, and drop Content-Length when duplicates conflict or cannot be parsed as valid non-negative integers.
- Add regression tests covering stripped framing headers and strict Content-Length handling.

Fixes imroc#542

Signed-off-by: duongynhi000005-oss <duongynhi000005@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upstream Sync Report 2026-09-23: HTTP/2 response smuggling via malformed framing headers (CVE-2026-78660)

1 participant