MEDIUM · CVSS 3.1 4.7 EPSS 0.2% · 13th percentile CWE-362CWE-79

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

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
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 vectorNetwork
Attack complexityHigh
Privileges requiredNone
User interactionRequired
ScopeChanged
ConfidentialityLow
IntegrityLow
AvailabilityNone

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

Source records: GHSA-h7wh-q2qr-458c (OSV.dev) · EPSS by FIRST, 2026-11-21.