GHSA-8rfp-98v4-mmr6: Bleach URI Sanitization Allows Disallowed URI Vulnerability

LOW
CVSS 0.0
CWE-184
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-8rfp-98v4-mmr6
Severity LOW
CVSS v3.1 Base Score 0.0
CWE Classification CWE-184: Incomplete List of Disallowed Inputs
Affected Product Bleach
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability None (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.

bleach fixed: 6.4.0
pip install bleach>=6.4.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 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

### Impact A possible XSS bypass affects users calling `bleach.clean` with all of: * `a` in the allowed tags * `href` in allowed attributes The `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: - Bleach's output contains URI values that violate the caller's protocol allowlist, breaking the sanitizer's contract. - 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. This is not a direct XSS vulnerability. Python code example from reporter with Bleach v6.3.0 and Python 3.13: ``` import bleach payload1 = '<a href="javascript\u200b:alert(document.cookie)">Click me</a>' result1 = bleach.clean(payload1) print(f"(ZWSP): {repr(result1)}") ``` Output: ``` (ZWSP): '<a href="javascript\u200b:alert(document.cookie)">Click me</a>' ``` ### Patches Users should upgrade to Bleach 6.4.0. ### Workarounds Pre-process content removing non-ASCII characters from URI schemes before sanitizing with `bleach.clean`. A 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. ### References * https://bugzilla.mozilla.org/show_bug.cgi?id=2023812 * RFC 3986, Section 3.1 (URI Scheme syntax): scheme characters are restricted to ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) ### Reported by Reported by codeant from CodeAnt AI.

GHSA-8rfp-98v4-mmr6 Affected Bleach Versions

1 component(s)
Fixed Versions:
6.4.0
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?
GHSA-8rfp-98v4-mmr6 is a security vulnerability in Bleach involving URI sanitization allows disallowed URI schemes with Unicode > U+00A0 in output under CWE-184: Incomplete List of Disallowed Inputs.
Which Bleach versions are affected?
Affected versions include releases prior to 6.4.0 across affected packages: bleach.
What version fixes GHSA-8rfp-98v4-mmr6?
Upgrading to 6.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bleach affected?
Yes, bleach is affected in releases prior to 6.4.0. Upgrade your dependency to 6.4.0 or later.
What is the CVSS score of GHSA-8rfp-98v4-mmr6?
GHSA-8rfp-98v4-mmr6 has a CVSS v3.1 base score of 0.0 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:N.
What CWE is associated with GHSA-8rfp-98v4-mmr6?
GHSA-8rfp-98v4-mmr6 is classified under CWE-184: Incomplete List of Disallowed Inputs (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.).
How can I check PyPI dependencies for GHSA-8rfp-98v4-mmr6?
Run the dependency tree command: 'pip show bleach'. 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-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
  }
}