GHSA-CJ75-F6XR-R4G7

GHSA-CJ75-F6XR-R4G7 is a medium-severity cross-site scripting (XSS) vulnerability in rails-html-sanitizer (rubygems), affecting versions >= 1.0.3, < 1.7.1. It is fixed in 1.7.1.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Rails HTML Sanitizers: Possible XSS vulnerability with certain configurations

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 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

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

Credit

Found by maintainer Mike Dalessio during a security audit.

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.

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

Affected versions

rails-html-sanitizer (>= 1.0.3, < 1.7.1)

Security releases

rails-html-sanitizer → 1.7.1 (rubygems)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade rails-html-sanitizer to 1.7.1 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is GHSA-CJ75-F6XR-R4G7? GHSA-CJ75-F6XR-R4G7 is a medium-severity cross-site scripting (XSS) vulnerability in rails-html-sanitizer (rubygems), affecting versions >= 1.0.3, < 1.7.1. It is fixed in 1.7.1. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. Which versions of rails-html-sanitizer are affected by GHSA-CJ75-F6XR-R4G7? rails-html-sanitizer (rubygems) versions >= 1.0.3, < 1.7.1 is affected.
  3. Is there a fix for GHSA-CJ75-F6XR-R4G7? Yes. GHSA-CJ75-F6XR-R4G7 is fixed in 1.7.1. Upgrade to this version or later.
  4. Is GHSA-CJ75-F6XR-R4G7 exploitable, and should I be worried? Whether GHSA-CJ75-F6XR-R4G7 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether GHSA-CJ75-F6XR-R4G7 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix GHSA-CJ75-F6XR-R4G7? Upgrade rails-html-sanitizer to 1.7.1 or later.

Other vulnerabilities in rails-html-sanitizer

Stop the waste.
Protect your environment with Kodem.