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-CJ75-F6XR-R4G7GHSA-9WJQ-CP2P-HRGFSeverity: 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 vulnerability could potentially lead to script execution in the context of the sanitized document if the referenced document contains scripts.

What happened

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

The affected component is the rails-html-sanitizer gem, specifically versions >=1.0.3 and <1.7.1. It is recommended to upgrade to version 1.7.1 of the gem and ensure that SVG reference elements are not included in the overridden allowed tags to mitigate the risk.

Professional software engineers assessing their exposure should consult the primary sources for more detailed information. The primary source indicates that the vulnerability appears to affect certain configurations of the gem, but further details are still under investigation. It is advised to stay updated with the latest information from the official sources.

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