BIT-libpython-2025-13836: Excessive read buffering DoS in http.client
When reading an HTTP response from a server, if no read amount is specified, the default behavior will be to use Content-Length. This allows a malicious server to cause the client to read large amounts of data into memory, potentially causing OOM or other DoS.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications that use Python's http.client to read HTTP responses without specifying a read amount are exposed when they connect to a malicious or untrusted server. The server can provide a large Content-Length value that causes the client to buffer a large amount of response data in memory.
What does an attacker need to exploit it?
An attacker needs to control, or be able to influence responses from, a server contacted by the vulnerable client. No authentication or user interaction is required, but exploitation depends on the client reading the response without a specified read amount.
Are applications using default read behavior affected?
Yes. The issue is specifically triggered by the default behavior when no read amount is supplied, which uses the response Content-Length.
What can be done if patching is not immediately possible?
Avoid reading HTTP responses without specifying a read amount. Use bounded reads so that response data is processed in controlled amounts rather than allocating memory based on an untrusted Content-Length value.