CVE-2020-26137: Urllib3 CRLF Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-wqvq-5m8c-6g24
CVSS 6.5
CWE-74
Published
Advisory Summary

CVE-2020-26137 is a MODERATE (CVSS 6.5) crlf injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Urllib3 libraries in the PyPI ecosystem. The issue involves crlf injection in urllib3. Remediation is available by upgrading affected packages to version 1.25.9.

CVE-2020-26137 at a Glance

CVE Identifier CVE-2020-26137
GHSA Identifier GHSA-wqvq-5m8c-6g24
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Urllib3
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2020-26137

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

urllib3 fixed: 1.25.9
pip install urllib3>=1.25.9
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 urllib3

How to Check if You Are Affected

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

pip show urllib3

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Urllib3, 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

urllib3 before 1.25.9 allows CRLF injection if the attacker controls the HTTP request method, as demonstrated by inserting CR and LF control characters in the first argument of `putrequest()`. NOTE: this is similar to CVE-2020-26116.

CVE-2020-26137 Affected Urllib3 Versions

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

References

Frequently Asked Questions

What is CVE-2020-26137?
CVE-2020-26137 is a security vulnerability in Urllib3 involving CRLF injection in urllib3 under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Urllib3 versions are affected?
Affected versions include releases prior to 1.25.9 across affected packages: urllib3.
What version fixes CVE-2020-26137?
Upgrading to 1.25.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is urllib3 affected?
Yes, urllib3 is affected in releases prior to 1.25.9. Upgrade your dependency to 1.25.9 or later.
What is the CVSS score of CVE-2020-26137?
CVE-2020-26137 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2020-26137?
CVE-2020-26137 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2020-26137?
Run the dependency tree command: 'pip show urllib3'. 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-wqvq-5m8c-6g24",
  "modified" : "2024-11-18T22:42:10Z",
  "published" : "2021-06-18T18:46:43Z",
  "aliases" : [ "CVE-2020-26137" ],
  "summary" : "CRLF injection in urllib3",
  "details" : "urllib3 before 1.25.9 allows CRLF injection if the attacker controls the HTTP request method, as demonstrated by inserting CR and LF control characters in the first argument of `putrequest()`. NOTE: this is similar to CVE-2020-26116.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "urllib3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.25.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26137"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/urllib3/urllib3/pull/1800"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/urllib3/urllib3/commit/1dd69c5c5982fae7c87a620d487c2ebf7a6b436b"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.python.org/issue39603"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2020-148.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/urllib3/urllib3"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2021/06/msg00015.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/10/msg00012.html"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4570-1"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-17T22:13:47Z",
    "nvd_published_at" : "2020-09-30T18:15:00Z"
  }
}