Update dependency httplib2 to v0.19.0 [SECURITY] #140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==0.17.0
->==0.19.0
GitHub Vulnerability Alerts
CVE-2020-11078
Impact
Attacker controlling unescaped part of uri for
httplib2.Http.request()
could change request headers and body, send additional hidden requests to same server.Impacts software that uses httplib2 with uri constructed by string concatenation, as opposed to proper urllib building with escaping.
Patches
Problem has been fixed in 0.18.0
Space, CR, LF characters are now quoted before any use.
This solution should not impact any valid usage of httplib2 library, that is uri constructed by urllib.
Workarounds
Create URI with
urllib.parse
family functions:urlencode
,urlunsplit
.References
https://cwe.mitre.org/data/definitions/93.html
https://docs.python.org/3/library/urllib.parse.html
Thanks to Recar https://github.com/Ciyfly for finding vulnerability and discrete notification.
For more information
If you have any questions or comments about this advisory:
CVE-2021-21240
Impact
A malicious server which responds with long series of
\xa0
characters in thewww-authenticate
header may cause Denial of Service (CPU burn while parsing header) of the httplib2 client accessing said server.Patches
Version 0.19.0 contains new implementation of auth headers parsing, using pyparsing library.
https://github.com/httplib2/httplib2/pull/182
Workarounds
Technical Details
The vulnerable regular expression is https://github.com/httplib2/httplib2/blob/595e248d0958c00e83cb28f136a2a54772772b50/python3/httplib2/__init__.py#L336-L338
The section before the equals sign contains multiple overlapping groups. Ignoring the optional part containing a comma, we have:
Since all three infinitely repeating groups accept the non-breaking space character
\xa0
, a long string of\xa0
causes catastrophic backtracking.The complexity is cubic, so doubling the length of the malicious string of
\xa0
makes processing take 8 times as long.Reproduction Steps
Run a malicious server which responds with
but with many more
\xa0
characters.An example malicious python server is below:
Connect to the server with httplib2:
To benchmark performance with shorter strings, you can set the path to a number e.g. http://localhost:1337/1000
References
Thanks to Ben Caller (Doyensec) for finding vulnerability and discrete notification.
For more information
If you have any questions or comments about this advisory:
Release Notes
httplib2/httplib2
v0.19.0
Compare Source
v0.18.1
Compare Source
v0.18.0
Compare Source
v0.17.4
Compare Source
v0.17.3
Compare Source
v0.17.2
Compare Source
v0.17.1
Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.