Repository navigation
CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response #88188
Copy link
Copy link
Closed
Closed
Copy link
Labels
3.10 (EOL)end of lifeend of life3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-securityA security issueA security issue
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/gpshead'
closed_at = <Date 2021-05-05.22:50:44.568>
created_at = <Date 2021-05-03.17:13:03.971>
labels = ['type-security', '3.8', '3.9', '3.10', '3.7', 'library']
title = 'CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response'
updated_at = <Date 2021-09-15.09:49:12.121>
user = 'https://bugs.python.org/leveryd'bugs.python.org fields:
activity = <Date 2021-09-15.09:49:12.121>
actor = 'vstinner'
assignee = 'gregory.p.smith'
closed = True
closed_date = <Date 2021-05-05.22:50:44.568>
closer = 'gregory.p.smith'
components = ['Library (Lib)']
creation = <Date 2021-05-03.17:13:03.971>
creator = 'leveryd'
dependencies = []
files = []
hgrepos = []
issue_num = 44022
keywords = ['patch']
message_count = 29.0
messages = ['392825', '393004', '393005', '393037', '393048', '393050', '393051', '393073', '393074', '393076', '393079', '393110', '393113', '393137', '393194', '393195', '394898', '394976', '394978', '394980', '394982', '394985', '394986', '396993', '397322', '399275', '401819', '401820', '401821']
nosy_count = 11.0
nosy_names = ['gregory.p.smith', 'vstinner', 'christian.heimes', 'ned.deily', 'mcepl', 'lukasz.langa', 'mgorny', 'sir-sigurd', 'miss-islington', 'leveryd', 'gen-xu']
pr_nums = ['25916', '25931', '25932', '25933', '25934', '25935', '26503', '26504', '26505', '26506', '26507', '26508', '27033']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'security'
url = 'https://bugs.python.org/issue44022'
versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-securityA security issueA security issue
Activity
leveryd commentedon May 3, 2021
if a client request a http/https/ftp service which is controlled by attacker, attacker can make this client hang forever, event client has set "timeout" argument.
maybe this client also will consume more and more memory. i does not test on this conclusion.
client.py
evil_server.py
gen-xu commentedon May 5, 2021
Added a possible PR. Review will be appreicated.
gen-xu commentedon May 5, 2021
Looks like it is caused by the httplib not limiting total header size after receiving 100. Added a counter for that to be same size as _MAXLINE=65536.
[-]"urllib" will result to deny of service[/-][+]urllib http client possible infinite loop on a 100 Continue response[/+]45 remaining items
ned-deily commentedon Jun 3, 2021
New changeset 1b6f4e5 by Miss Islington (bot) in branch '3.6':
bpo-44022: Improve the regression test. (GH-26503) (GH-26508)
1b6f4e5
miss-islington commentedon Jul 5, 2021
New changeset 7ac7a0c by Sergey Fedoseev in branch 'main':
bpo-44022: Fix Sphinx role in NEWS entry (GH-27033)
7ac7a0c
ambv commentedon Jul 12, 2021
New changeset 0389426 by Miss Islington (bot) in branch '3.8':
bpo-44022: Improve the regression test. (GH-26503) (bpo-26506)
0389426
mcepl commentedon Aug 9, 2021
Is there a CVE for this?
vstinner commentedon Sep 15, 2021
Matej Cepl: "Is there a CVE for this?"
Yes, CVE-2021-3737 was assigned to this issue.
[-]urllib http client possible infinite loop on a 100 Continue response[/-][+]CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response[/+][-]urllib http client possible infinite loop on a 100 Continue response[/-][+]CVE-2021-3737: urllib http client possible infinite loop on a 100 Continue response[/+]vstinner commentedon Sep 15, 2021
I created https://python-security.readthedocs.io/vuln/urllib-100-continue-loop.html to track the issue.
vstinner commentedon Sep 15, 2021
I'm not sure why the fix in the main branch was not listed here:
commit 47895e3
Author: Gen Xu <xgbarry@gmail.com>
Date: Wed May 5 15:42:41 2021 -0700
gh-150743: Limit trailer lines and interim responses read by http.cli…
[3.14] gh-150743: Limit trailer lines and interim responses read by h…
[3.15] gh-150743: Limit trailer lines and interim responses read by h…
[3.13] gh-150743: Limit trailer lines and interim responses read by h…
[3.12] gh-150743: Limit trailer lines and interim responses read by h…