GEM · JULY 2026 · EARLY WARNING

Possible XSS Vulnerability in rails-html-sanitizer Gem: Early Warning

EARLY WARNING · UNCONFIRMED. This page describes a developing threat that 0Day surfaced from early signals and has not yet independently confirmed. Details may change. Always verify against the primary sources before acting.
GHSA-9WJQ-CP2P-HRGFGHSA-CJ75-F6XR-R4G7Severity: HIGH

An early warning has been issued regarding a possible cross-site scripting (XSS) vulnerability in the rails-html-sanitizer gem, specifically when configured to allow certain SVG reference elements. This could potentially lead to script execution in the context of the sanitized document.

What happened

Reportedly, a cross-site scripting vulnerability exists in the rails-html-sanitizer gem when it is configured to allow specific SVG reference elements. This configuration can result in the execution of scripts within the sanitized document if the referenced document contains scripts. The vulnerability is under investigation and has been tracked with IDs GHSA-9WJQ-CP2P-HRGF and GHSA-CJ75-F6XR-R4G7.

The affected versions of the rails-html-sanitizer gem are those greater than or equal to 1.0.3 and less than 1.7.1. It is recommended to upgrade to version 1.7.1 and remove SVG reference elements from the overridden allowed tags if they are included. For more detailed information, please consult the primary sources: [GHSA-9wjq-cp2p-hrgf](https://github.com/flavorjones/loofah/security/advisories/GHSA-9wjq-cp2p-hrgf) and [GHSA-cj75-f6xr-r4g7](https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-cj75-f6xr-r4g7).

Professional software engineers are advised to review their configurations and assess their exposure to this potential vulnerability. It is crucial to stay updated with the latest information from the primary sources as the situation develops.

How 0Day mitigates this

MATCHED TO YOUR ACTUAL DEPENDENCY GRAPH0Day matches every incoming threat signal against your GitHub organization’s full dependency graph, including transitive dependencies. If rails-html-sanitizer is anywhere in your dependency tree, the engineers who own the affected repositories get a push alert the moment it is flagged — no manual audit to remember to run.

Read how this differs from waiting on a scanner to catch a known advisory, or see the exact, read-only access 0Day needs to do this for an organization.

Join the 0Day waitlist →

← Back to all threats