CVE-2026-128069: rails-html-sanitizer Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-h7wh-q2qr-458c
CVSS 4.7
CWE-362 CWE-79
Published
Advisory Summary

CVE-2026-128069 is a MODERATE (CVSS 4.7) cross-site scripting vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting rails-html-sanitizer libraries in the RubyGems ecosystem. The issue involves possible xss via shared scrubber state in concurrent calls. Remediation is available by upgrading affected packages to version 1.7.2.

CVE-2026-128069 at a Glance

CVE Identifier CVE-2026-128069
GHSA Identifier GHSA-h7wh-q2qr-458c
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product rails-html-sanitizer
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-128069

To remediate this vulnerability, upgrade all affected rails-html-sanitizer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rails-html-sanitizer fixed: 1.7.2
Upgrade rails-html-sanitizer to 1.7.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rails-html-sanitizer

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-128069, inspect your project dependencies for rails-html-sanitizer:

inspect dependencies for rails-html-sanitizer

Analyze the terminal output to locate any version of rails-html-sanitizer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In rails-html-sanitizer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-128069 Affected rails-html-sanitizer Versions

1 component(s)
Fixed Versions:
1.7.2
Product / Package Ecosystem Affected Versions Fixed Version
rails-html-sanitizer
RubyGems
< 1.7.2
1.7.2

References

Frequently Asked Questions

What is CVE-2026-128069?
CVE-2026-128069 is a security vulnerability in rails-html-sanitizer involving Possible XSS via shared scrubber state in concurrent calls under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which rails-html-sanitizer versions are affected?
Affected versions include releases prior to 1.7.2 across affected packages: rails-html-sanitizer.
What version fixes CVE-2026-128069?
Upgrading to 1.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rails-html-sanitizer affected?
Yes, rails-html-sanitizer is affected in releases prior to 1.7.2. Upgrade your dependency to 1.7.2 or later.
What is the CVSS score of CVE-2026-128069?
CVE-2026-128069 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-128069?
CVE-2026-128069 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check RubyGems dependencies for CVE-2026-128069?
Run the dependency tree command: 'inspect dependencies for rails-html-sanitizer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h7wh-q2qr-458c",
  "modified" : "2026-11-13T18:09:16Z",
  "published" : "2026-11-13T18:09:16Z",
  "aliases" : [ "CVE-2026-128069" ],
  "summary" : "rails-html-sanitizer: Possible XSS via shared scrubber state in concurrent calls",
  "details" : "## Summary\n\n`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.\n\n- Versions affected: `< 1.7.2`\n- Not affected: none\n- Fixed versions: `1.7.2`\n\n## Impact\n\nAction 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.\n\nApplications 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.\n\n## Workarounds\n\nUse 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.\n\n## Credit\n\nReported by hiumee via HackerOne.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rails-html-sanitizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-h7wh-q2qr-458c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/issues/228"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/commit/15f764c3563d5dd9b97ad32eaa7454577ccec4b9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails-html-sanitizer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/GHSA-h7wh-q2qr-458c.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-13T18:09:16Z",
    "nvd_published_at" : null
  }
}