CVE-2026-128069: rails-html-sanitizer: Possible XSS via shared scrubber state in concurrent calls
Summary Rails::HTML::SafeListSanitizer (both the HTML4 and HTML5 variants) shares one Rails::HTML::PermitScrubber across every sanitize call on the same instance, assigning its tags and attributes on each call without synchronization. Two concurrent sanitize calls with different tags: or attributes: options can interleave, so one call is scrubbed with the other call's allowlist.
Published Nov 13, 2026
Affected packages
rails-html-sanitizer
- Ecosystem
- RubyGems
- Affected
- < 1.7.2
- Fixed in
- 1.7.2
- Check
bundle info rails-html-sanitizer
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Rails::HTML::SafeListSanitizer (both the HTML4 and HTML5 variants) shares one Rails::HTML::PermitScrubber across every sanitize call on the same instance, assigning its tags and attributes on each call without synchronization. Two concurrent sanitize calls with different tags: or attributes: options can interleave, so one call is scrubbed with the other call's allowlist.
- Versions affected:
< 1.7.2 - Not affected: none
- Fixed versions:
1.7.2
Impact
Action View memoizes a single SafeListSanitizer per helper module and uses it for every sanitize call in the process, so in a multi-threaded server (for example Puma) all requests share the same PermitScrubber. If any code path calls sanitize with a more permissive allowlist, an attacker who can trigger that path concurrently with another request can cause the other request to be sanitized with the permissive allowlist. If the permissive allowlist admits script or an event-handler attribute, the strict call emits it unchanged, which is a cross-site scripting vector when the strict output is stored or rendered to other users.
Applications are affected only if they run more than one thread per process and some sanitize call passes tags: or attributes: options that differ from another call's, including a call that passes no options and so uses the defaults. Applications that use a single configuration everywhere, pass their own scrubber:, or run single-threaded are not affected.
Workarounds
Use the same allowlist for every sanitize call, or pass a scrubber: built per call (Rails::HTML::PermitScrubber.new with tags= and attributes= set) instead of tags: and attributes: options.
Credit
Reported by hiumee via HackerOne.
References
- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-h7wh-q2qr-458c
- https://github.com/rails/rails-html-sanitizer/issues/228
- https://github.com/rails/rails-html-sanitizer/commit/15f764c3563d5dd9b97ad32eaa7454577ccec4b9
- https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.2
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/GHSA-h7wh-q2qr-458c.yml
- https://github.com/advisories/GHSA-h7wh-q2qr-458c
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More RubyGems vulnerabilities
All RubyGems entriesCVE-2026-128068
rails-html-sanitizer: Possible regular expression denial of service with certain configurations
medium5.3Nov 13, 2026CVE-2026-73648
Rails HTML Sanitizers: Possible XSS vulnerability with certain configurations
medium5.1Jul 21, 2026CVE-2024-53985
rails-html-sanitize has XSS vulnerability with certain configurations
low2.3Dec 2, 2024CVE-2024-53986
rails-html-sanitizer has XSS vulnerability with certain configurations
low2.3Dec 2, 2024CVE-2024-53987
rails-html-sanitizer has XSS vulnerability with certain configurations
low2.3Dec 2, 2024CVE-2024-53988
rails-html-sanitizer has XSS vulnerability with certain configurations
low2.3Dec 2, 2024
