CVE-2025-13836
cpython: Excessive read buffering DoS in http.client
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · December 2, 2025
Updated · June 30, 2026
Description
A flaw was found in the http.client module in the Python standard library. When reading an HTTP response from a server, if no read amount is specified, the default behavior will be to use Content-Length. This issue allows a malicious server to cause the client to read large amounts of data into memory, potentially causing memory allocations errors, swapping, out-of-memory conditions or even system freezes.
Statement
This issue can only be exploited by Python applications using the http.client.HTTPResponse.read function without the amount parameter, which specifies the read size in bytes. Note that Python libraries may use this function internally and make applications vulnerable. Additionally, vulnerable Python applications must connect to a malicious or compromised server that replies with a very large or crafted Content-Length header to trigger this issue, limiting the exposure of this vulnerability.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Since this vulnerability is triggered when no read amount is specified and the client defaults to using the potentially malicious Content-Length header, developers can mitigate this issue in their code by always imposing an explicit, safe limit on data reads.
Applications using the http.client.HTTPResponse.read function directly can ensure that read operations specify a byte limit:
...
max_safe_read = 10 * 1024 * 1024
data = response.read(max_safe_read)
...
CVSS / CWE
CVSS 3.1 · 6.8CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:N/A:H
CWE-770 · Allocation of Resources Without Limits or Throttling