REDHAT-BUG-2571445: Medium severity go Go vulnerability
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
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
HTTP/1 servers that use MaxBytesReader or MaxBytesHandler are exposed when their handlers can read the request body concurrently with writing the response header.
What conditions are required for a crash?
The request body must exceed the configured MaxBytesReader limit, causing the server to automatically set "Connection: close" while another operation explicitly sets a response header. The unsynchronized concurrent header updates can trigger a runtime panic.
How can I determine whether my service is affected?
Review HTTP/1 handler code for use of MaxBytesReader or MaxBytesHandler and check whether request-body reads may occur concurrently with response-header writes. Services without that concurrent behavior are not described as affected.
What can be done before a fix is available?
Avoid allowing request-body reads and response-header writes to run concurrently in handlers that use MaxBytesReader or MaxBytesHandler. This prevents the concurrent header-setting condition described for the panic.