CVE-2018-7753: Bleach Bleach URI Scheme Restriction Bypass Vulnerability
CRITICALCVE-2018-7753 is a CRITICAL (CVSS 9.8) bleach uri scheme restriction bypass vulnerability (CWE-20: Improper Input Validation) affecting Bleach libraries in the PyPI ecosystem. The issue involves bleach uri scheme restriction bypass. Remediation is available by upgrading affected packages to version 2.1.3.
CVE-2018-7753 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2018-7753
To remediate this vulnerability, upgrade all affected Bleach 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 bleach>=2.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show bleach
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2018-7753, inspect your installed packages using pip:
pip show bleach
Analyze the terminal output to locate any version of Bleach in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.3), your application is affected.
Note: The pip show bleach command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Bleach, 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-2018-7753 Affected Bleach Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bleach
|
PyPI |
≥ 2.1.0
< 2.1.3
|
2.1.3
|
References
Frequently Asked Questions
What is CVE-2018-7753?
Which Bleach versions are affected?
What version fixes CVE-2018-7753?
Is bleach affected?
What is the CVSS score of CVE-2018-7753?
What CWE is associated with CVE-2018-7753?
How can I check PyPI dependencies for CVE-2018-7753?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m9mq-p2f9-cfqv",
"modified" : "2024-09-04T19:41:50Z",
"published" : "2019-01-04T17:46:30Z",
"aliases" : [ "CVE-2018-7753" ],
"summary" : "Bleach URI Scheme Restriction Bypass",
"details" : "An issue was discovered in Bleach 2.1.x before 2.1.3. Attributes that have URI values weren't properly sanitized if the values contained character entities. Using character entities, it was possible to construct a URI value with a scheme that was not allowed that would slide through unsanitized.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "bleach"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-7753"
}, {
"type" : "WEB",
"url" : "https://github.com/mozilla/bleach/commit/c5df5789ec3471a31311f42c2d19fc2cf21b35ef"
}, {
"type" : "WEB",
"url" : "https://bugs.debian.org/892252"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mozilla/bleach"
}, {
"type" : "WEB",
"url" : "https://github.com/mozilla/bleach/releases/tag/v2.1.3"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/bleach/PYSEC-2018-51.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:45:43Z",
"nvd_published_at" : null
}
}