All vulnerabilities

RubyGems

CVE-2026-128069

rails-html-sanitizer: Possible XSS via shared scrubber state in concurrent calls

Severity
Medium 4.7
Published
13 Nov 2026
Last changed
13 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.7.2
Exploit chance
0.2% in the next 30 daysHigher than 11% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Race condition (CWE-362)Cross-site scripting (CWE-79)
Attack
Over the network · Only under certain conditions · No login needed · Needs someone to click or open something
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Also known as
GHSA-h7wh-q2qr-458c
Sources
OSV.dev and GitHub

Description

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

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

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.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
rails-html-sanitizerRubyGems · osv:RubyGems:rails-html-sanitizer
  • Every version before 1.7.2

About rails-html-sanitizer

Total downloads (RubyGems)
740,363,891RubyGems, 24 Nov 2026

Vulnerabilities in rails-html-sanitizer

In our list
2
Published in the last 12 months
2
Critical, last 12 months
0
High, last 12 months
0
Known exploited
0
Search the list for rails-html-sanitizer

References