Skip to main content

rails-html-sanitizer EUVDEUVD-2026-125593

| CVE-2026-128069 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-11-13 GitHub_M GHSA-h7wh-q2qr-458c
4.7
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify multithreaded app with permissive sanitize path
  2. Delivery
    Send concurrent requests to strict and permissive endpoints
  3. Exploit
    Race interleaves shared PermitScrubber allowlist
  4. Execution
    Strict response retains script or event-handler
  5. Impact
    Stored XSS executes in victim browser

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

All three conditions must hold in the target application: (1) it runs more than one thread per process (e.g. Puma in multithreaded mode); (2) its code calls Rails::HTML::SafeListSanitizer (HTML4 or HTML5 variant) / the Action View sanitize helper with tags: or attributes: options that differ between call sites - including a call passing no options and thus using defaults - and at least one of those allowlists is permissive enough to admit a script element or an event-handler attribute; and (3) an attacker can trigger that permissive path concurrently with a stricter call whose output is stored or rendered to other users. Limiting factors that make a deployment NOT affected, per the advisory: single-threaded processes, using one identical allowlist everywhere, or passing a per-call scrubber: (Rails::HTML::PermitScrubber.new with tags= and attributes= set) instead of the tags:/attributes: options. Exploitation also requires that the strict output actually be rendered to a victim (UI:R), and reliable triggering requires winning the interleaving race (AC:H).

Impact

This is a genuine but moderate-priority XSS (CVE-2026-128069, CWE-79 compounded by CWE-362 race condition per the GHSA advisory). The vendor CVSS 3.1 vector CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N scores 4.7 (medium): network-reachable and unauthenticated (PR:N), but deliberately rated AC:H because reliable exploitation depends on winning a concurrency race between two in-flight sanitize calls, and UI:R because the tainted output must be rendered to a victim. Scope is Changed (S:C) since injected script executes in victim browsers rather than the app process. No CISA KEV entry is present in the input, so this is NOT confirmed actively exploited; the vuln.today decision label is 'this_month', not act_now/emergency. No EPSS score was supplied, so exploitation probability cannot be quantified from this data. The fix commit includes a regression test that deterministically reproduces the interleaving via an artificial reentrant hook - a public proof-of-concept of the mechanism, not verified as a working multithreaded exploit, and the input carries no explicit POC flag. The signals are internally consistent: medium CVSS, no KEV, no EPSS, month-level priority all point to a real-but-not-emergency issue whose practical risk is gated by application configuration (multithreading plus mixed allowlists). The main caveat is that impact is conditional on the host application's own sanitize usage, not on the library in isolation - a low-CVSS-looking issue that can become serious XSS in a narrow set of real deployments.

Exploit ScenarioDerived

A Rails app runs on a multithreaded server (e.g. Puma) and calls the memoized Action View sanitizer with different allowlists on different paths - one path permissive enough to admit a script element or event-handler attribute. An attacker repeatedly triggers the permissive path concurrently with a stricter sanitize call so the shared PermitScrubber's tags/attributes interleave, causing the strict call to emit attacker script unchanged; when that output is stored and rendered to other users it executes as XSS. A regression test in the fix commit demonstrates the interleaving deterministically, but no weaponized exploit is published and the AC:H rating reflects that reliable triggering requires winning the race.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 13, 2026

Cross-site scripting in the rails-html-sanitizer gem before 1.7.2 lets a concurrent request be sanitized with another call's more permissive allowlist, so a stricter call can emit script elements or event-handler attributes that the application expects to have been stripped. The flaw only manifests in multi-threaded Ruby processes (for example Puma with more than one thread) where sanitize is called with differing tags: or attributes: options, and where an attacker can trigger the permissive path while a stricter, rendered output is being produced; single-threaded apps, apps with one uniform allowlist, and apps passing their own scrubber: are not affected. Exploitation requires winning a race window and rendering the poisoned output to a victim (CVSS 3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, 4.7), and no public exploit code was identified at time of analysis; the vendor-released fix is 1.7.2.

RemediationAI

Vendor-released patch: upgrade rails-html-sanitizer to 1.7.2 (release tag v1.7.2, fix commit 15f764c3563d5dd9b97ad32eaa7454577ccec4b9), which stops sharing a PermitScrubber across calls by constructing one per scrub; update the Gemfile/Gemfile.lock constraint accordingly, since the gem is a transitive dependency of Rails. If the upgrade cannot be scheduled on the normal monthly cadence, the advisory lists two workarounds: use one identical allowlist for every sanitize call (side effect: it removes the per-call flexibility the code currently relies on, and unifying toward a permissive list widens exposure while unifying toward a strict list may strip markup some views need), or pass a per-call scrubber: built with Rails::HTML::PermitScrubber.new and explicit tags=/attributes= instead of the tags:/attributes: options (side effect: an extra scrubber object is allocated per sanitize call, a small throughput cost, and every call site must be audited and converted or the race remains reachable). Multi-threaded deployments with mixed allowlists should treat the upgrade as the only complete fix, since neither workaround is enforced by the library.

Affected VersionsENISA

rails-html-sanitizer < 1.7.2

Affected Packages

rubygems rails-html-sanitizer fix: 1.7.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Rails::HTML::SafeListSanitizer (both the HTML4 and HTML5 variants) wraps Loofah/Nokogiri fragment scrubbing with a Rails::HTML::PermitScrubber that carries the allowlist as mutable tags and attributes state. Before 1.7.2 the sanitizer instance allocated a single PermitScrubber in its initializer and, on every scrub call, assigned @permit_scrubber.tags and @permit_scrubber.attributes before invoking fragment.scrub!. Action View memoizes one SafeListSanitizer per helper module and reuses it for every sanitize call in the process, so that mutable scrubber is effectively process-wide shared state with no synchronization, which is the CWE-362 race condition underlying the CWE-79 injection outcome. When two threads interleave between the attribute assignment and the scrub, one call can be scrubbed under the other call's allowlist; if the permissive call admitted script or an event handler, the strict call's output retains active markup. The 1.7.2 commit (15f764c3563d5dd9b97ad32eaa7454577ccec4b9) removes the shared instance entirely: the initializer now stores only @prune and each scrub builds a fresh PermitScrubber with its own tags and attributes, and a regression test exercises a re-entrant sanitize call to confirm no cross-call configuration bleed. The HTMLElement/attribute parsing path itself is unchanged; the defect is purely the lifetime and sharing of the scrubber object, which is why per-call scrubber: usage was never vulnerable.

Know when Rails gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 4.7 MEDIUM
AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 4.7 MEDIUM

Unauthenticated network trigger (PR:N), but reliable exploitation requires winning a concurrency race (AC:H) and the tainted output must be rendered to a victim (UI:R); script crosses into the browser (S:C) with limited C/I and no availability impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

2
Patch available
Nov 13, 2026 - 18:04 EUVD
CVE Published
Nov 13, 2026 - 17:17 cve.org
MEDIUM 4.7

DescriptionCVE.org

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Before 1.7.2, the HTML4 and HTML5 variants of Rails::HTML::SafeListSanitizer reuse one Rails::HTML::PermitScrubber across calls and mutate its tags and attributes without synchronization. In a multithreaded process, concurrent sanitize calls using different tags: or attributes: options can interleave and cause one call to use the other call's allowlist. If a permissive call admits a script element or event-handler attribute, output expected to be sanitized under a stricter policy can retain it and cause cross-site scripting when rendered. Applications that are single-threaded, use one identical allowlist everywhere, or provide a separate scrubber: are not affected. This issue is fixed in version 1.7.2.

Threat Intelligence Overview

EPSS Score
0.2%
Top 87% exploitable
Prevalence
High
default Action View HTML-sanitizing dependency across most Rails applications
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
High

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Rails

View all
CVE-2016-0752 HIGH POC
7.5 Feb 16

Directory traversal vulnerability in Action View in Ruby on Rails before 3.2.22.1, 4.0.x and 4.1.x before 4.1.14.1, 4.2.

CVE-2013-0333 HIGH POC
7.5 Jan 30

lib/active_support/json/backends/yaml.rb in Ruby on Rails 2.3.x before 2.3.16 and 3.0.x before 3.0.20 does not properly

CVE-2013-0156 HIGH POC
7.5 Jan 13

active_support/core_ext/hash/conversions.rb in Ruby on Rails before 2.3.15, 3.0.x before 3.0.19, 3.1.x before 3.1.10, an

CVE-2016-2098 HIGH POC
7.3 Apr 07

Action Pack in Ruby on Rails before 3.2.22.2, 4.x before 4.1.14.2, and 4.2.x before 4.2.5.2 allows remote attackers to e

CVE-2014-0130 HIGH
7.5 May 07

Directory traversal vulnerability in actionpack/lib/abstract_controller/base.rb in the implicit-render implementation in

CVE-2013-6414 MEDIUM POC
5.0 Dec 07

actionpack/lib/action_view/lookup_context.rb in Action View in Ruby on Rails 3.x before 3.2.16 and 4.x before 4.0.2 allo

CVE-2019-5420 CRITICAL POC
9.8 Mar 27

A remote code execution vulnerability in development mode Rails <5.2.2.1, <6.0.0.beta3 can allow an attacker to guess th

CVE-2020-8165 CRITICAL POC
9.8 Jun 19

A deserialization of untrusted data vulnernerability exists in rails < 5.2.4.3, rails < 6.0.3.1 that can allow an attack

CVE-2020-8163 HIGH POC
8.8 Jul 02

The is a code injection vulnerability in versions of Rails prior to 5.0.1 that wouldallow an attacker who controlled the

CVE-2017-17917 HIGH POC
8.1 Dec 29

SQL injection vulnerability in the 'where' method in Ruby on Rails 5.1.4 and earlier allows remote attackers to execute

CVE-2017-17916 HIGH POC
8.1 Dec 29

SQL injection vulnerability in the 'find_by' method in Ruby on Rails 5.1.4 and earlier allows remote attackers to execut

CVE-2012-6496 HIGH POC
7.5 Jan 04

SQL injection vulnerability in the Active Record component in Ruby on Rails before 3.0.18, 3.1.x before 3.1.9, and 3.2.x

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy