Skip to content
Noroxi
OSV ecosystem advisory

GHSA-gj48-438w-jh9v: Bleach clean() / Cleaner() fails to sanitize dangerous URI schemes in allowed formaction attributes

MediumCVSS 6.1 · v3.1—No exploit Fix available

Noroxi assessment

Priority: Monitor (action score 24/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Anyone who can reach it over the internet can trigger it. No account or password is required. A user must open a link or visit a page. No special conditions are required; it is repeatable.
  • Fixed version: bleach (PyPI) 6.4.0.

Low priority for now. Upgrade to bleach (PyPI) 6.4.0 or later.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: OSV

### 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. --- ### Details The issue appears to be a URI-sanitization coverage gap in Bleach’s sanitizer logic. Relevant code paths: * `bleach/sanitizer.py` — `BleachSanitizerFilter.allow_token` (around line 553) * `bleach/_vendor/html5lib/filters/sanitizer.py` — `attr_val_is_uri` (around line 525) In `BleachSanitizerFilter.allow_token`, URI protocol sanitization is only applied when: ```python id="pft79m" if namespaced_name in self.attr_val_is_uri: ``` However, `(None, 'formaction')` is currently missing from `attr_val_is_uri`. This creates an inconsistency where `action` is protocol-sanitized, but `formaction` is not. As a result, if a downstream application allows: * tags such as `<button>` or `<input>` * the `formaction` attribute then Bleach preserves dangerous URI schemes such as `javascript:` in `formaction`. Examples of affected submit-capable controls include: * `<button>` (default submit behavior unless `type="button"` is set) * `<input type="submit">` * `<input type="image">` This appears to be a real library-side sanitizer gap rather than only an application misuse issue, because Bleach already treats similar URI-bearing attributes (such as `action`) as protocol-sensitive and sanitizes them. Suggested minimal fix: Add: ```python id="4v4fkn" (None, 'formaction') ``` to `attr_val_is_uri` in: * `bleach/_vendor/html5lib/filters/sanitizer.py` I also prepared a minimal patch and focused regression tests if helpful. --- ### PoC Below are minimal reproductions using `bleach.clean()`. #### 1) `<button>` ```python id="d3g0v7" from bleach import clean print(clean( '<form><button formaction="javascript:alert(1)">go</button></form>', tags={'form', 'button'}, attributes={'button': ['formaction']}, )) ``` **Actual output:** ```html id="i4nd7s" <form><button formaction="javascript:alert(1)">go</button></form> ``` **Expected output:** ```html id="g4d2r1" <form><button>go</button></form> ``` --- #### 2) `<input type="submit">` ```python id="l4dy0j" print(clean( '<form><input type="submit" formaction="javascript:alert(1)" value="go"></form>', tags={'form', 'input'}, attributes={'input': ['type', 'formaction', 'value']}, )) ``` **Actual output:** ```html id="h8lgbt" <form><input type="submit" formaction="javascript:alert(1)" value="go"></form> ``` **Expected output:** ```html id="6y8mws" <form><input type="submit" value="go"></form> ``` --- #### 3) `<input type="image">` ```python id="g8q0x8" print(clean( '<form><input type="image" formaction="javascript:alert(1)" src="/foo.png"></form>', tags={'form', 'input'}, attributes={'input': ['type', 'formaction', 'src']}, )) ``` **Actual output:** ```html id="fd22kg" <form><input type="image" formaction="javascript:alert(1)" src="/foo.png"></form> ``` **Expected output:** ```html id="z6t6je" <form><input type="image" src="/foo.png"></form> ``` --- ### Impact This is a **client-side HTML sanitization bypass / dangerous URI preservation issue**. If an application relies on Bleach to sanitize untrusted HTML and explicitly allows: * `formaction` * and submit-capable controls such as `<button>` or `<input>` then Bleach can emit sanitized output that still contains a dangerous `javascript:` URI in `formaction`. That can lead to **submit-triggered JavaScript execution** when the user activates the control. Impact is limited to configurations that explicitly allow the relevant tag/attribute combination, but the issue is still security-relevant because: * `formaction` is a real browser sink * Bleach already protocol-sanitizes similar URI-bearing attributes like `action` * the omission creates inconsistent sanitizer coverage for dangerous URI schemes I would currently assess this as **Medium severity**. If useful, I also have: * a minimal patch * focused regression tests for: * `<button formaction="javascript:...">` * `<input type="submit" formaction="javascript:...">` * `<input type="image" formaction="javascript:...">` * a safe control case where `formaction="/submit"` is preserved

Published
Jun 16, 2026
Updated
Sep 10, 2026
EPSS
—

Report tools

JSON

Action score

24

Monitor

Low priority for now.

CVSS
24 / 40 · 6.1 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · —

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • A fix has been released

If any of these changes, we'll tell you in the daily email digest.

Follow GHSA-gj48-438w-jh9v

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Limit the impact of XSSCheck security headers

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools

Limit the impact of XSSCheck security headers

Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
PyPIbleach

Limit the impact of XSS

This is a cross-site scripting (XSS) vulnerability. A well-configured Content-Security-Policy doesn't fix it, but greatly reduces its impact. Check your site's CSP and other security headers for free.

Check security headers

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
PyPIbleachbefore 6.4.06.4.0

Same product

PyPI: all records

Other highest-scoring records for the same primary product.

  • GHSA-g75f-g53v-794xBleach linkify(parse_email=True) CPU exhaustion via unbounded email regex scanning
    17Monitor
  • GHSA-8rfp-98v4-mmr6Bleach: URI sanitization allows disallowed URI schemes with Unicode > U+00A0 in output
    0Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
PyPI:bleach6.4.0Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • A user must open a link or visit a page.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
low · data can be read
Integrity
low · data or configuration can be modified
Availability
none

Impact can extend beyond the vulnerable component (scope changes).

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality impact
Low
Integrity impact
Low
Availability impact
None

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

osv

Root cause

User content is inserted into the page as HTML. The browser interprets the content as code rather than data.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
commentEl.innerHTML = comment.body;

Fixed

ts
commentEl.textContent = comment.body;

References

Show all references (2 more)

Vendor advisories and official records. Exploit/PoC links are deliberately left out.

All records