GO-2026-6859: HTTP/1 server crash due to MaxBytesReader header race in net/http
For HTTP/1 servers, when MaxBytesReader's limit is exceeded, "Connection: close" header is automatically set without synchronization, which might race with another header being set explicitly in the server handler. As a result, an HTTP/1 server that utilizes MaxBytesReader or MaxBytesHandler can crash due to runtime panic if its handler reads the request body concurrently with writing the response header.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/stdlibto a version that resolves this vulnerability.Fixed in 1.26.11 - Upgrade
Upgrade
go/stdlibto a version that resolves this vulnerability.Fixed in 1.27.4