Race Condition Affecting rails-html-sanitizer package, versions <1.7.2


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.22% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-RAILSHTMLSANITIZER-22840492
  • published24 Nov 2026
  • disclosed13 Nov 2026
  • credithiumee

Introduced: 13 Nov 2026

NewCVE-2026-128069  (opens in a new tab)
CWE-362  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade rails-html-sanitizer to version 1.7.2 or higher.

Overview

Affected versions of this package are vulnerable to Race Condition via the HTML4 and HTML5 SafeListSanitizer variants in lib/rails/html/sanitizer.rb. In a multithreaded process, an attacker can trigger concurrent sanitize calls with different tags: or attributes: allowlists, causing one call to use the other’s configuration. Because Action View shares a sanitizer instance, a stricter call can leave script elements or event-handler attributes in its output when another call uses a more permissive allowlist; those can execute when the output is rendered to users.

Workarounds

  • Use the same tags: and attributes: allowlists for every sanitize call to prevent concurrent calls from using one another’s allowlists.
  • Pass a scrubber: built separately for each call with Rails::HTML::PermitScrubber.new, setting its tags and attributes, instead of passing per-call tags: or attributes: options. This prevents concurrent calls from sharing allowlist state.

CVSS Base Scores

version 4.0
version 3.1