GitHub Advisoryadvisory · RubyGems
GHSA-cj75-f6xr-r4g7 Rails HTML Sanitizers: Possible XSS vulnerability with certain configurations
MEDIUM
Official page ↗
- Aliases
- CVE-2026-73648
- Ecosystem
- RubyGems
- Packages
- rails-html-sanitizer
- Severity
- Moderate
- CVSS vector
- 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
- Weaknesses
- CWE-79
- Reviewed
- 2026-07-21
Affected packages
• RubyGems rails-html-sanitizer: >= 1.0.3, < 1.7.1 → fixed in 1.7.1
Description
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 ``. See related GHSA-9wjq-cp2p-hrgf in Loofah, whose SVG local-reference logic rails-html-sanitizer mirrors.
• Versions affected: `>= 1.0.3, ` 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. `` 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 `` or ``. 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
• CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Credit
Found by maintainer Mike Dalessio during a security audit.
Related
Alias · CVE (1)
- CVE-2026-73648 rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-cj75-f6xr-r4g7 web
- https://github.com/rails/rails-html-sanitizer/commit/74dcb8053e6da9921246ce71b06ad9fd65b19586 web
- https://github.com/rails/rails-html-sanitizer package
- https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.1 web