GHSA-8rfp-98v4-mmr6: Bleach URI Sanitization Allows Disallowed URI Vulnerability
LOWGHSA-8rfp-98v4-mmr6 is a LOW (CVSS 0.0) uri sanitization allows disallowed uri vulnerability (CWE-184: Incomplete List of Disallowed Inputs) affecting Bleach libraries in the PyPI ecosystem. The issue involves uri sanitization allows disallowed uri schemes with unicode > u+00a0 in output. Remediation is available by upgrading affected packages to version 6.4.0.
GHSA-8rfp-98v4-mmr6 at a Glance
Security Impact
CVSS: 0.0
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:R/S:U/C:N/I:N/A:N).
How to Fix GHSA-8rfp-98v4-mmr6
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>=6.4.0
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 GHSA-8rfp-98v4-mmr6, 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 6.4.0), 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-184: Incomplete List of Disallowed Inputs, where the product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete. 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
GHSA-8rfp-98v4-mmr6 Affected Bleach Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bleach
|
PyPI |
< 6.4.0
|
6.4.0
|
References
Frequently Asked Questions
What is GHSA-8rfp-98v4-mmr6?
Which Bleach versions are affected?
What version fixes GHSA-8rfp-98v4-mmr6?
Is bleach affected?
What is the CVSS score of GHSA-8rfp-98v4-mmr6?
What CWE is associated with GHSA-8rfp-98v4-mmr6?
How can I check PyPI dependencies for GHSA-8rfp-98v4-mmr6?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8rfp-98v4-mmr6",
"modified" : "2026-06-16T14:06:30Z",
"published" : "2026-06-16T14:06:29Z",
"aliases" : [ ],
"summary" : "Bleach: URI sanitization allows disallowed URI schemes with Unicode > U+00A0 in output",
"details" : "### Impact\n\nA possible XSS bypass affects users calling `bleach.clean` with all of:\n\n* `a` in the allowed tags\n* `href` in allowed attributes\n\nThe `bleach.clean` sanitizer outputs URIs containing disallowed scheme patterns that it should be stripping. However, because the inserted Unicode characters make the scheme invalid per RFC 3986, modern browsers do not execute these as javascript: URIs. The practical security impact is limited to:\n\n- Bleach's output contains URI values that violate the caller's protocol allowlist, breaking the sanitizer's contract.\n- If a downstream system performs its own Unicode normalization on bleach's output (stripping invisible characters before rendering), the javascript: scheme could become valid. This is a non-standard processing chain but represents a theoretical secondary risk.\n\nThis is not a direct XSS vulnerability.\n\nPython code example from reporter with Bleach v6.3.0 and Python 3.13:\n\n```\nimport bleach\npayload1 = '<a href=\"javascript\\u200b:alert(document.cookie)\">Click me</a>'\nresult1 = bleach.clean(payload1)\nprint(f\"(ZWSP): {repr(result1)}\")\n```\n\nOutput:\n\n```\n(ZWSP): '<a href=\"javascript\\u200b:alert(document.cookie)\">Click me</a>'\n```\n\n### Patches\n\nUsers should upgrade to Bleach 6.4.0.\n\n### Workarounds\n\nPre-process content removing non-ASCII characters from URI schemes before sanitizing with `bleach.clean`.\n\nA strong[ Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) without unsafe-inline and unsafe-eval[ script-srcs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src) will also help mitigate the risk.\n\n### References\n\n* https://bugzilla.mozilla.org/show_bug.cgi?id=2023812\n* RFC 3986, Section 3.1 (URI Scheme syntax): scheme characters are restricted to ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n\n### Reported by \n\nReported by codeant from CodeAnt AI.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "bleach"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.4.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 6.3.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mozilla/bleach/security/advisories/GHSA-8rfp-98v4-mmr6"
}, {
"type" : "WEB",
"url" : "https://bugzilla.mozilla.org/show_bug.cgi?id=2023812"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mozilla/bleach"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-184" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-16T14:06:29Z",
"nvd_published_at" : null
}
}