CVE-2026-73648: Rails HTML Sanitizers Cross-Site Scripting Vulnerability
MODERATECVE-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.
CVE-2026-73648 at a Glance
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.
Upgrade rails-html-sanitizer to 1.7.1
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
CVE-2026-73648 Affected Rails HTML Sanitizers Versions
1 component(s)| 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?
Which Rails HTML Sanitizers versions are affected?
What version fixes CVE-2026-73648?
Is rails-html-sanitizer affected?
What CWE is associated with CVE-2026-73648?
How can I check RubyGems dependencies for CVE-2026-73648?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}