CVE-2020-11078: CRLF injection in httplib2
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.
diff userinput = " HTTP/1.1\r\ninjected: attack\r\nignore-http:" -uri = "https://api.server/?q={}".format(userinput) +uri = urllib.parse.urlunsplit(("https", "api.server", "/v1", urllib.parse.urlencode({"q": userinput}), "")) http.request(uri)
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: Open an issue in httplib2 Email current maintainer at 2020-05
Other sources
In httplib2 before version 0.18.0, an attacker controlling unescaped part of uri for httplib2.Http.request() could change request headers and body, send additional hidden requests to same server. This vulnerability impacts software that uses httplib2 with uri constructed by string concatenation, as opposed to proper urllib building with escaping. This has been fixed in 0.18.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/httplib2to a version that resolves this vulnerability.Fixed in 0.18.0 - Upgrade
Upgrade
redhat/httplib2to a version that resolves this vulnerability.Fixed in 0.18.0 - Upgrade
Upgrade
azurelinux/python-httplib2to a version that resolves this vulnerability.Fixed in 0:0.22.0-11.azl4 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.18.0 - Compensating control
Construct URIs with urllib.parse functions such as urlencode and urlunsplit, rather than concatenating unescaped input into the URI.
Event History
Frequently Asked Questions
What is the severity of CVE-2020-11078?
CVE-2020-11078 has a medium severity rating due to the potential for unauthorized request manipulation.
How do I fix CVE-2020-11078?
To fix CVE-2020-11078, upgrade httplib2 to version 0.18.0 or later.
Which software versions are affected by CVE-2020-11078?
CVE-2020-11078 affects versions of httplib2 prior to 0.18.0 and certain versions of Fedora and Debian.
Can CVE-2020-11078 lead to unauthorized data access?
Yes, CVE-2020-11078 can potentially allow attackers to manipulate request headers and bodies, which could lead to unauthorized data access.
What types of applications are impacted by CVE-2020-11078?
Applications using httplib2 with URIs constructed by string concatenation are impacted by CVE-2020-11078.