Vulnerabilities in pkg:gem/rails-html-sanitizer

PACKAGE
Advisory Identifier: GHSA-cj75-f6xr-r4g7
Advisory Summary

CVE-2026-73648 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Rails HTML Sanitizers libraries in the RubyGems ecosystem. The issue involves possible xss vulnerability with certain configurations. Remediation is available by upgrading affected packages to version 1.7.1.

18 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rails-html-sanitizer

18 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/rails-html-sanitizer. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-cj75-f6xr-r4g7 CVE-2026-73648 MODERATE Rails HTML Sanitizers: Possible XSS vulnerability with certain configurations
GHSA-rrfc-7g8p-99q8 CVE-2022-23520 MODERATE Possible XSS vulnerability with certain configurations of rails-html-sanitizer
GHSA-9h9g-93gc-623h CVE-2022-23519 MODERATE Possible XSS vulnerability with certain configurations of rails-html-sanitizer
GHSA-mcvf-2q2m-x72m CVE-2022-23518 MODERATE Improper neutralization of data URIs may allow XSS in rails-html-sanitizer
GHSA-5x79-w82f-gw8w CVE-2022-23517 HIGH Inefficient Regular Expression Complexity in rails-html-sanitizer
GHSA-pg8v-g4xq-hww9 CVE-2022-32209 MODERATE Rails::Html::Sanitizer vulnerable to Cross-site Scripting
GHSA-rxv5-gxqc-xx8g CVE-2024-53989 LOW rails-html-sanitizer has XSS vulnerability with certain configurations
GHSA-cfjx-w229-hgx5 CVE-2024-53988 LOW rails-html-sanitizer has XSS vulnerability with certain configurations
GHSA-2x5m-9ch4-qgrr CVE-2024-53987 LOW rails-html-sanitizer has XSS vulnerability with certain configurations
GHSA-638j-pmjw-jq48 CVE-2024-53986 LOW rails-html-sanitizer has XSS vulnerability with certain configurations
GHSA-w8gc-x259-rc7x CVE-2024-53985 LOW rails-html-sanitize has XSS vulnerability with certain configurations
GHSA-px3r-jm9g-c8w8 CVE-2018-3741 MODERATE rails-html-sanitizer Cross-site Scripting vulnerability
GHSA-r9c2-cr39-c8g6 CVE-2015-7579 MODERATE rails-html-sanitizer Cross-site Scripting vulnerability
GHSA-ghqm-pgxj-37gq CVE-2015-7580 MODERATE rails-html-sanitizer Cross-site Scripting vulnerability
GHSA-59c7-4xj2-hgvw CVE-2015-7578 MODERATE rails-html-sanitizer Cross-site Scripting vulnerability
GHSA-qc8j-m8j3-rjq6 - MODERATE Moderate severity vulnerability that affects rails-html-sanitizer
GHSA-mrhj-2g4v-39qx - MODERATE Moderate severity vulnerability that affects rails-html-sanitizer
GHSA-77pc-q5q7-qg9h - MODERATE Moderate severity vulnerability that affects rails-html-sanitizer

CVE-2026-73648 at a Glance

CVE Identifier CVE-2026-73648
GHSA Identifier GHSA-cj75-f6xr-r4g7
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Rails HTML Sanitizers
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2026-73648

To remediate this vulnerability, upgrade all affected Rails HTML Sanitizers 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.1
Upgrade rails-html-sanitizer to 1.7.1
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-73648, inspect your project dependencies for Rails HTML Sanitizers:

inspect dependencies for rails-html-sanitizer

Analyze the terminal output to locate any version of Rails HTML Sanitizers in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.1), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Rails HTML Sanitizers, 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 There is a possible cross-site scripting vulnerability in rails-html-sanitizer when the sanitizer is configured to allow an SVG reference element such as `<use>`. See related [GHSA-9wjq-cp2p-hrgf](https://github.com/flavorjones/loofah/security/advisories/GHSA-9wjq-cp2p-hrgf) in Loofah, whose SVG local-reference logic rails-html-sanitizer mirrors. - Versions affected: `>= 1.0.3, < 1.7.1` - Not affected: `< 1.0.3` - Fixed versions: `1.7.1` ## Impact `Rails::HTML::PermitScrubber` restricts SVG reference elements in the `SVG_ALLOW_LOCAL_HREF` collection to local, same-document references, but that restriction covered only the `xlink:href` attribute. Browsers also accept a plain `href` attribute per the SVG 2 spec, and it was not restricted, so those elements could reference arbitrary external documents. SVG `<use>` can load and render external SVG content by reference, and if the referenced document is same-origin and contains scripts, it could execute in the context of the sanitized document. `<feImage>` can load external images, which can be used for tracking. Applications are impacted only when the allowed tags are overridden to include one of these SVG reference elements, for example `<use>` or `<feImage>`. The default allowed tags do not include these SVG elements, so applications using the default configuration are not affected. ## Workarounds Remove the SVG reference elements (such as `use` and `feImage`) from the overridden allowed tags. Applications using the default allowed tags are not affected. ## References - [GHSA-9wjq-cp2p-hrgf: SVG `href` attribute bypasses local-reference restriction in Loofah](https://github.com/flavorjones/loofah/security/advisories/GHSA-9wjq-cp2p-hrgf) - [CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')](https://cwe.mitre.org/data/definitions/79.html) ## Credit Found by maintainer Mike Dalessio during a security audit.

CVE-2026-73648 Affected Rails HTML Sanitizers Versions

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

References

Frequently Asked Questions

What is CVE-2026-73648?
CVE-2026-73648 is a security vulnerability in Rails HTML Sanitizers involving Possible XSS vulnerability with certain configurations under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Rails HTML Sanitizers versions are affected?
Affected versions include releases prior to 1.7.1 across affected packages: rails-html-sanitizer.
What version fixes CVE-2026-73648?
Upgrading to 1.7.1 (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.1. Upgrade your dependency to 1.7.1 or later.
What CWE is associated with CVE-2026-73648?
CVE-2026-73648 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for CVE-2026-73648?
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-cj75-f6xr-r4g7",
  "modified" : "2026-08-13T18:00:24Z",
  "published" : "2026-07-21T22:05:28Z",
  "aliases" : [ "CVE-2026-73648" ],
  "summary" : "Rails HTML Sanitizers: Possible XSS vulnerability with certain configurations",
  "details" : "## Summary\n\nThere is a possible cross-site scripting vulnerability in rails-html-sanitizer when the sanitizer is configured to allow an SVG reference element such as `<use>`. See related [GHSA-9wjq-cp2p-hrgf](https://github.com/flavorjones/loofah/security/advisories/GHSA-9wjq-cp2p-hrgf) in Loofah, whose SVG local-reference logic rails-html-sanitizer mirrors.\n\n- Versions affected: `>= 1.0.3, < 1.7.1`\n- Not affected: `< 1.0.3`\n- Fixed versions: `1.7.1`\n\n## Impact\n\n`Rails::HTML::PermitScrubber` restricts SVG reference elements in the `SVG_ALLOW_LOCAL_HREF` collection to local, same-document references, but that restriction covered only the `xlink:href` attribute. Browsers also accept a plain `href` attribute per the SVG 2 spec, and it was not restricted, so those elements could reference arbitrary external documents. SVG `<use>` can load and render external SVG content by reference, and if the referenced document is same-origin and contains scripts, it could execute in the context of the sanitized document. `<feImage>` can load external images, which can be used for tracking.\n\nApplications are impacted only when the allowed tags are overridden to include one of these SVG reference elements, for example `<use>` or `<feImage>`. The default allowed tags do not include these SVG elements, so applications using the default configuration are not affected.\n\n## Workarounds\n\nRemove the SVG reference elements (such as `use` and `feImage`) from the overridden allowed tags. Applications using the default allowed tags are not affected.\n\n## References\n\n- [GHSA-9wjq-cp2p-hrgf: SVG `href` attribute bypasses local-reference restriction in Loofah](https://github.com/flavorjones/loofah/security/advisories/GHSA-9wjq-cp2p-hrgf)\n- [CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')](https://cwe.mitre.org/data/definitions/79.html)\n\n## Credit\n\nFound by maintainer Mike Dalessio during a security audit.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rails-html-sanitizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.3"
      }, {
        "fixed" : "1.7.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-cj75-f6xr-r4g7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/commit/74dcb8053e6da9921246ce71b06ad9fd65b19586"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails-html-sanitizer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-21T22:05:28Z",
    "nvd_published_at" : null
  }
}