CVE-2020-26137: Urllib3 CRLF Injection Vulnerability
MODERATECVE-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
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).
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.
pip install urllib3>=1.25.9
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
CVE-2020-26137 Affected Urllib3 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
urllib3
|
PyPI |
< 1.25.9
|
1.25.9
|
References
Frequently Asked Questions
What is CVE-2020-26137?
Which Urllib3 versions are affected?
What version fixes CVE-2020-26137?
Is urllib3 affected?
What is the CVSS score of CVE-2020-26137?
What CWE is associated with CVE-2020-26137?
How can I check PyPI dependencies for CVE-2020-26137?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}