CVE-2020-11078: Httplib2 CRLF Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-gg84-qgv9-w4pq
CVSS 6.8
CWE-93
Published
Advisory Summary

CVE-2020-11078 is a MODERATE (CVSS 6.8) crlf injection vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting Httplib2 libraries in the PyPI ecosystem. The issue involves crlf injection in httplib2. Remediation is available by upgrading affected packages to version 0.18.0.

CVE-2020-11078 at a Glance

CVE Identifier CVE-2020-11078
GHSA Identifier GHSA-gg84-qgv9-w4pq
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
Affected Product Httplib2
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2020-11078

To remediate this vulnerability, upgrade all affected Httplib2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

httplib2 fixed: 0.18.0
pip install httplib2>=0.18.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show httplib2

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2020-11078, inspect your installed packages using pip:

pip show httplib2

Analyze the terminal output to locate any version of Httplib2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.18.0), your application is affected.

Note: The pip show httplib2 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In Httplib2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: * Open an issue in [httplib2](https://github.com/httplib2/httplib2/issues/new) * Email [current maintainer at 2020-05](mailto:temotor@gmail.com)

CVE-2020-11078 Affected Httplib2 Versions

1 component(s)
Fixed Versions:
0.18.0
Product / Package Ecosystem Affected Versions Fixed Version
httplib2
PyPI
< 0.18.0
0.18.0

References

GitHub Advisory / Wiki ADVISORY
https://github.com/httplib2/httplib2/security/advisories/GHSA-gg84-qgv9-w4pq
NVD — CVE-2020-11078 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-11078
Security Fix Commit FIX COMMIT
https://github.com/httplib2/httplib2/commit/a1457cc31f3206cf691d11d2bf34e98865873e9e
Httplib2 Source Repository REPOSITORY
https://github.com/httplib2/httplib2
Httplib2 Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/httplib2/PYSEC-2020-46.yaml
lists.apache.org/thread.html/r237111... WEB
https://lists.apache.org/thread.html/r23711190c2e98152cb6f216b95090d5eeb978543bb7e0bad22ce47fc@%3Cissues.beam.apache.org%3E
lists.apache.org/thread.html/r4d35da... WEB
https://lists.apache.org/thread.html/r4d35dac106fab979f0db75a07fc4e320ad848b722103e79667ff99e1@%3Cissues.beam.apache.org%3E
lists.apache.org/thread.html/r69a462... WEB
https://lists.apache.org/thread.html/r69a462e690b5f2c3d418a288a2c98ae764d58587bd0b5d6ab141f25f@%3Cissues.beam.apache.org%3E
lists.apache.org/thread.html/r7f3640... WEB
https://lists.apache.org/thread.html/r7f364000066748299b331b615ba51c62f55ab5b201ddce9a22d98202@%3Cissues.beam.apache.org%3E
lists.apache.org/thread.html/rad8872... WEB
https://lists.apache.org/thread.html/rad8872fc99f670958c2774e2bf84ee32a3a0562a0c787465cf3dfa23@%3Cissues.beam.apache.org%3E
lists.apache.org/thread.html/rc9eff9... WEB
https://lists.apache.org/thread.html/rc9eff9572946142b657c900fe63ea4bbd3535911e8d4ce4d08fe4b89@%3Ccommits.allura.apache.org%3E
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2020/06/msg00000.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IXCX2AWROGWGY5GXR7VN3BKF34A2FO6J
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PZJ3D6JSM7CFZESZZKGUW2VX55BOSOXI

Frequently Asked Questions

What is CVE-2020-11078?
CVE-2020-11078 is a security vulnerability in Httplib2 involving CRLF injection in httplib2 under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection').
Which Httplib2 versions are affected?
Affected versions include releases prior to 0.18.0 across affected packages: httplib2.
What version fixes CVE-2020-11078?
Upgrading to 0.18.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is httplib2 affected?
Yes, httplib2 is affected in releases prior to 0.18.0. Upgrade your dependency to 0.18.0 or later.
What is the CVSS score of CVE-2020-11078?
CVE-2020-11078 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2020-11078?
CVE-2020-11078 is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') (The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.).
How can I check PyPI dependencies for CVE-2020-11078?
Run the dependency tree command: 'pip show httplib2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gg84-qgv9-w4pq",
  "modified" : "2024-09-20T21:55:12Z",
  "published" : "2020-05-20T15:55:47Z",
  "aliases" : [ "CVE-2020-11078" ],
  "summary" : "CRLF injection in httplib2",
  "details" : "### Impact\nAttacker controlling unescaped part of uri for `httplib2.Http.request()` could change request headers and body, send additional hidden requests to same server.\n\nImpacts software that uses httplib2 with uri constructed by string concatenation, as opposed to proper urllib building with escaping.\n\n### Patches\nProblem has been fixed in 0.18.0\nSpace, CR, LF characters are now quoted before any use.\nThis solution should not impact any valid usage of httplib2 library, that is uri constructed by urllib.\n\n### Workarounds\nCreate URI with `urllib.parse` family functions: `urlencode`, `urlunsplit`.\n\n```diff\nuser_input = \" HTTP/1.1\\r\\ninjected: attack\\r\\nignore-http:\"\n-uri = \"https://api.server/?q={}\".format(user_input)\n+uri = urllib.parse.urlunsplit((\"https\", \"api.server\", \"/v1\", urllib.parse.urlencode({\"q\": user_input}), \"\"))\nhttp.request(uri)\n```\n\n### References\nhttps://cwe.mitre.org/data/definitions/93.html\nhttps://docs.python.org/3/library/urllib.parse.html\n\nThanks to Recar https://github.com/Ciyfly for finding vulnerability and discrete notification.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [httplib2](https://github.com/httplib2/httplib2/issues/new)\n* Email [current maintainer at 2020-05](mailto:temotor@gmail.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:N/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "httplib2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.18.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/httplib2/httplib2/security/advisories/GHSA-gg84-qgv9-w4pq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-11078"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/httplib2/httplib2/commit/a1457cc31f3206cf691d11d2bf34e98865873e9e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/httplib2/httplib2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/httplib2/PYSEC-2020-46.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r23711190c2e98152cb6f216b95090d5eeb978543bb7e0bad22ce47fc@%3Cissues.beam.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4d35dac106fab979f0db75a07fc4e320ad848b722103e79667ff99e1@%3Cissues.beam.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r69a462e690b5f2c3d418a288a2c98ae764d58587bd0b5d6ab141f25f@%3Cissues.beam.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r7f364000066748299b331b615ba51c62f55ab5b201ddce9a22d98202@%3Cissues.beam.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rad8872fc99f670958c2774e2bf84ee32a3a0562a0c787465cf3dfa23@%3Cissues.beam.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc9eff9572946142b657c900fe63ea4bbd3535911e8d4ce4d08fe4b89@%3Ccommits.allura.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/06/msg00000.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IXCX2AWROGWGY5GXR7VN3BKF34A2FO6J"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PZJ3D6JSM7CFZESZZKGUW2VX55BOSOXI"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-93" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-05-20T15:55:36Z",
    "nvd_published_at" : null
  }
}