Medium

CRLF injection in httplib2

  • Disclosed: 20.05.2020
  • Updated: 11.10.2026 15:17

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
user_input = " HTTP/1.1\r\ninjected: attack\r\nignore-http:"
-uri = "https://api.server/?q={}".format(user_input)
+uri = urllib.parse.urlunsplit(("https", "api.server", "/v1", urllib.parse.urlencode({"q": user_input}), ""))
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:

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) httplib2 < 0.18.0 0.18.0

References

CVSS score 6.8/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N
Weakness (CWE)
CWE-93
Platform
Python (PyPI)
Package
httplib2
Disclosed
20.05.2020
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2020-46 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-gg84-qgv9-w4pq - CC BY 4.0

Vulnerability history: httplib2

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
4
First → latest
01.2014 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 2
  • Medium 2

Disclosures per year

  1. 2017: 0
  2. 2018: 0
  3. 2019: 0
  4. 2020: 1
  5. 2021: 1
  6. 2022: 0
  7. 2023: 0
  8. 2024: 0
  9. 2025: 0
  10. 2026: 1

earlier: 1

  1. High · 7.5 CVE-2021-21240 < 0.19.0 0.19.0
  2. CRLF injection in httplib2 this entry
    Medium · 6.8 CVE-2020-11078 < 0.18.0 0.18.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.