Skip to content

[3.10] gh-150743: Limit trailer lines and interim responses read by http.client (GH-150749) - #152529

Merged
pablogsal merged 1 commit into
python:3.10from
miss-islington:backport-84badb7-3.10
Jun 28, 2026
Merged

pablogsal merged 1 commit into
python:3.10from
miss-islington:backport-84badb7-3.10

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

http.client read chunked-response trailer lines and skipped interim (1xx)
responses in unbounded loops, so a server streaming either forever would
hang the client even with a socket timeout set (data keeps arriving, so
the timeout never fires).

Trailer lines are now limited to max_response_headers (100 by default)
and interim responses to 100; HTTPException is raised past either limit.

Follow-up to gh-88188 for CVE-2021-3737, which bounded header lines
within an interim response but not these two sibling loops.
(cherry picked from commit 84badb7)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com


This issue was reported to us via GHSA-w4q2-g22w-6fr4

…d by http.client (pythonGH-150749)

http.client read chunked-response trailer lines and skipped interim (1xx)
responses in unbounded loops, so a server streaming either forever would
hang the client even with a socket timeout set (data keeps arriving, so
the timeout never fires).

Trailer lines are now limited to max_response_headers (100 by default)
and interim responses to 100; HTTPException is raised past either limit.

Follow-up to pythongh-88188 for CVE-2021-3737, which bounded header lines
within an interim response but not these two sibling loops.
(cherry picked from commit 84badb7)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>

---

This issue was reported to us via [GHSA-w4q2-g22w-6fr4](https://github.com/python/cpython/security/advisories/GHSA-w4q2-g22w-6fr4)
@pablogsal
pablogsal merged commit 1790e58 into python:3.10 Jun 28, 2026
14 of 15 checks passed
@miss-islington
miss-islington deleted the backport-84badb7-3.10 branch June 28, 2026 20:50
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

3 participants