Skip to content

net/http: HTTP/1 client connection desynchronization after CONNECT rejection #81740

Closed

Description

@neild

When http.Transport sends an HTTP/1 CONNECT request with a non-empty
Request.Body, it writes the body directly to the connection without
framing after the request headers. If the server rejects the CONNECT
request with a non-2xx keep-alive response, Transport returns the
connection to the idle pool. Because CONNECT requests do not have a
request body, the server may interpret the trailing body bytes as a
subsequent pipelined HTTP/1.1 request on the connection, leaving the
pooled connection desynchronized and causing the next caller that reuses
it to read the response to the injected request. In reverse proxies
(including httputil.ReverseProxy) that forward CONNECT requests through
a shared Transport, this can lead to cross-user response poisoning.

The HTTP/1 transport now closes a connection after sending a CONNECT
request, regardless of the response status.

In addition, ReverseProxy now rejects incoming CONNECT requests
with a 405 Method Not Allowed response. ReverseProxy has never handled
CONNECT requests in a useful fashion (it does not convert the
connection into a bidirectional tunnel), so we do not expect this
change to negatively affect any current users.

Thanks to Xclow3n (Rajat Raghav) for reporting this issue.

This is CVE-2026-56866 and Go issue https://go.dev/issue/81740.


This was a PRIVATE track issue originally tracked in http://b/534709195.

Activity

  1. added this to the Go1.28 milestone on Sep 24, 2026
  2. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Sep 29, 2026
  3. removed
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Sep 30, 2026
  4. thatnealpatel commented on Sep 30, 2026

    @thatnealpatel
    Member

    @gopherbot Please open backports for this security issue.

  5. gopherbot commented on Sep 30, 2026

    @gopherbot
    Contributor

    Backport issue(s) opened: #81899 (for 1.26), #81900 (for 1.27).

    Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

  6. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Oct 5, 2026
  7. gopherbot commented on Oct 8, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/847027 mentions this issue: [release-branch.go1.27] net/http, net/http/httputil: avoid post-CONNECT pool corruption

  8. gopherbot commented on Oct 8, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/847107 mentions this issue: [release-branch.go1.26] net/http, net/http/httputil: avoid post-CONNECT pool corruption

  9. gopherbot commented on Oct 8, 2026

    @gopherbot
    Contributor

    Change https://go.dev/cl/847306 mentions this issue: net/http, net/http/httputil: avoid post-CONNECT pool corruption

  10. changed the title [-]security: fix CVE-2026-56866[/-] [+]net/http: HTTP/1 client connection desynchronization after CONNECT rejection[/+] on Oct 8, 2026
  11. removed
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions