Vulnerability GHSA-gj48-438w-jh9v

Medium Risk
MEDIUM RISK
CVSS Score: 6.1
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
5 months ago
June 16, 2026 at 02:07 PM UTC
Bleach clean() / Cleaner() fails to sanitize dangerous URI schemes in allowed formaction attributes
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 6.3.0
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 6.3.0

Summary

Bleach clean() / Cleaner() fails to sanitize dangerous URI schemes in allowed formaction attributes

Details

Summary

Bleach clean() / Cleaner() fails to sanitize dangerous URI schemes in allowed formaction attributes.

Bleach applies URI protocol sanitization only to attributes listed in attr_val_is_uri. While URI-bearing attributes such as action, href, src, and poster are included in that set, formaction is not. As a result, if a downstream application explicitly allows formaction on submit-capable controls in untrusted HTML, Bleach preserves dangerous values such as javascript:alert(1) instead of stripping them.

This can lead to submit-triggered JavaScript execution in applications that rely on Bleach to sanitize untrusted HTML and allow the relevant tag/attribute combination.

PoC

Below are minimal reproductions using bleach.clean().

1) <button>

from bleach import clean

print(clean(
    '<form><button formaction="javascript:alert(1)">go</button></form>',
    tags={'form', 'button'},
    attributes={'button': ['formaction']},
))

Actual output:

<form><button formaction="javascript:alert(1)">go</button></form>

Expected output:

<form><button>go</button></form>

3) <input type="image">

print(clean(
    '<form><input type="image" formaction="javascript:alert(1)" src="/foo.png"></form>',
    tags={'form', 'input'},
    attributes={'input': ['type', 'formaction', 'src']},
))

Actual output:

<form><input type="image" formaction="javascript:alert(1)" src="/foo.png"></form>

Expected output:

<form><input type="image" src="/foo.png"></form>

Related Vulnerabilities

Other vulnerabilities affecting the same packages

Medium Risk
5 months ago
Bleach linkify(parse_email=True) CPU exhaustion via unbounded email regex scanning
6.3.0 GHSA-g75f-g53v-794x
6.3.0 GHSA-g75f-g53v-794x
Low Risk
5 months ago
Bleach: URI sanitization allows disallowed URI schemes with Unicode > U+00A0 in output
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 6.3.0 GHSA-8rfp-98v4-mmr6
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 6.3.0 GHSA-8rfp-98v4-mmr6
Medium Risk
5 years ago
Cross-site scripting in Bleach
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 3.2.3 GHSA-vv2x-vrpj-qqpq
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 3.2.3 GHSA-vv2x-vrpj-qqpq
Unknown
5 years ago
No summary available
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 3.2.3 PYSEC-2021-865
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 3.2.3 PYSEC-2021-865
High Risk
6 years ago
regular expression denial-of-service (ReDoS) in Bleach
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 3.1.3 GHSA-vqhp-cxgc-6wmm
0.1 and 0.1.1 - 0.1.2 and 0.2 and 0.2.1 - 0.2.2 and 0.3 and 0.3.1 and 0.3.3 - 0.3.4 and 0.5.0 - 1.1.5 and 1.2 and 1.2.1 - 1.2.2 and 1.4 and 1.4.1 - 2.0.0 and 2.1 and 2.1.1 - 3.1.3 GHSA-vqhp-cxgc-6wmm
View all vulnerabilities for these packages

Impacted packages

Timeline

Published
5 months ago
June 16, 2026 at 02:07 PM UTC
Fixed (6.4.0)
6 months ago
June 05, 2026 at 01:01 PM UTC
Last Modified
5 hours ago
December 04, 2026 at 07:11 PM UTC