CVE-2026-128069: rails-html-sanitizer: Possible XSS via shared scrubber state in concurrent calls
Published 2026-11-13 · Updated 2026-11-13 · Also known as GHSA-h7wh-q2qr-458c
Summary
The rails-html-sanitizer gem fails to synchronize shared scrubber state during concurrent sanitize calls, potentially leading to cross-site scripting (XSS). Engineering teams should upgrade to version 1.7.2 or later to prevent sanitization bypasses in multi-threaded environments.
Who is affected
The vulnerability affects multi-threaded Ruby applications (such as those using Puma) that share a memoized SafeListSanitizer instance. If concurrent requests use different allowlist configurations for tags or attributes, the scrubber state may interleave, causing strict sanitization calls to inadvertently adopt a more permissive allowlist.
Exploitability
The vulnerability is rated as medium severity with a CVSS 3.1 score of 4.7, requiring high complexity to exploit due to the need for precise timing in concurrent threads. The current EPSS score is 0.002, and it is not listed in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade rails-html-sanitizer to version 1.7.2 or higher.
- Standardize the allowlist configuration across all sanitize calls to prevent state mismatch.
- Pass a per-call scrubber instance using Rails::HTML::PermitScrubber.new if dynamic allowlists are required.
How to check your project
- Check the Gemfile.lock file for rails-html-sanitizer versions prior to 1.7.2.
- Run 'bundle info rails-html-sanitizer' in the project directory to verify the installed version.
Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| RubyGems | rails-html-sanitizer |
>= 0, < 1.7.2 | 1.7.2 | bundle update rails-html-sanitizer |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | High |
| Privileges required | None |
| User interaction | Required |
| Scope | Changed |
| Confidentiality | Low |
| Integrity | Low |
| Availability | None |
FAQ
Are single-threaded applications at risk?
No, applications running in single-threaded mode are not affected because the race condition relies on concurrent thread interleaving.
Is this vulnerability actively being exploited?
Not documented; the vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
What specifically triggers the incorrect sanitization?
The flaw occurs when multiple threads call sanitize with differing 'tags:' or 'attributes:' options, causing the shared PermitScrubber instance to apply the wrong allowlist to a concurrent request.
Original advisory description
References
- WEB https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-h7wh-q2qr-458c
- WEB https://github.com/rails/rails-html-sanitizer/issues/228
- WEB https://github.com/rails/rails-html-sanitizer/commit/15f764c3563d5dd9b97ad32eaa7454577ccec4b9
- PACKAGE https://github.com/rails/rails-html-sanitizer
- WEB https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.2
- WEB https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/GHSA-h7wh-q2qr-458c.yml
Source records: GHSA-h7wh-q2qr-458c (OSV.dev) · EPSS by FIRST, 2026-11-21.