Skip to main content

rails-html-sanitizer CVE-2026-73648

| EUVDEUVD-2026-58191 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-08-13 security-advisories@github.com
5.1
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit SVG markup with plain href to content field
  2. Delivery
    Application sanitizer passes 'use' element due to missing href check
  3. Exploit
    Victim loads page with sanitized content
  4. Execution
    Browser resolves SVG 'use' href to same-origin external SVG
  5. Persist
    External SVG scripts execute in document context
  6. Impact
    Attacker achieves XSS (session theft or DOM manipulation)

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the application to have explicitly overridden the default rails-html-sanitizer allowed-tag list to include at least one SVG reference element - specifically 'use' or 'feImage'. Applications using the default allowed-tag configuration are confirmed not affected. For XSS via script execution, the externally referenced SVG document must be same-origin with the sanitized document; cross-origin SVG references are blocked by browser same-origin policy and do not enable script execution. The 'feImage' path enables cross-origin image loading for tracking purposes only, not script execution. User interaction is required (CVSS UI:A): a victim must load or view the page containing the sanitized, attacker-controlled content. There is no authentication requirement on the attacker side (PR:N), but the attacker must have the ability to submit content that passes through the sanitizer - typically requiring an account or some form of content submission access on the target application.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A, score 5.1) correctly reflects the moderate real-world risk: network-reachable with no special attack complexity, but user interaction is required and downstream system impact is limited to low confidentiality and low integrity changes (SC:L/SI:L). The single most significant limiting factor is that the vulnerability is only reachable when an application has explicitly overridden the default allowed-tag list to include SVG reference elements - a non-default, deliberate configuration choice. Applications on the default configuration are confirmed unaffected. There is no CISA KEV listing and no public exploit code identified, placing this in a low-urgency category for most operators. The EPSS signal is not provided in the input data and cannot be inferred. The most realistic harm is XSS via a same-origin SVG chained with existing attacker-controlled content, or pixel-tracking via feImage - neither a trivial nor a catastrophic outcome. A mid-sized development team running a Rails application with a custom rich-text or SVG-rendering feature should audit their PermitScrubber tag configuration before concluding they are unaffected, but the combination of non-default prerequisite, UI dependency, and absence of active exploitation means this is not a drop-everything emergency for the broad Rails ecosystem.

Exploit ScenarioDerived

An attacker submits user-generated content containing an SVG 'use' element with a plain 'href' pointing to a same-origin SVG file that includes a script payload. The sanitizer, misconfigured to allow 'use' and 'href', passes the element through intact. When a victim user views the sanitized content in their browser, the SVG 'use' reference is resolved, the external same-origin SVG is fetched and rendered, and its embedded script executes in the context of the sanitized document - enabling session theft, DOM manipulation, or credential harvesting. No public proof-of-concept code has been identified at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 13, 2026

Cross-site scripting in rails-html-sanitizer 1.0.3-1.7.0 allows external SVG references to bypass sanitization when applications use non-default allowed tags including SVG reference elements such as 'use' or 'feImage'. The PermitScrubber correctly blocked external hrefs via the legacy 'xlink:href' attribute but failed to apply the same restriction to the SVG 2 plain 'href' attribute, which modern browsers also honor. Exploitation via 'use' requires the external SVG to be same-origin for script execution; 'feImage' enables cross-origin image loading for user tracking. No public exploit or CISA KEV listing exists at time of analysis.

RemediationAI

Upgrade rails-html-sanitizer to version 1.7.1, which contains the corrected attribute name check in PermitScrubber and pins loofah to >= 2.25.2. The fix is available at https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.1 and the patch commit is https://github.com/rails/rails-html-sanitizer/commit/74dcb8053e6da9921246ce71b06ad9fd65b19586. If an immediate upgrade is not possible, the documented workaround is to remove SVG reference elements - specifically 'use' and 'feImage' - from any overridden allowed-tag lists in PermitScrubber configurations. This workaround eliminates the attack surface entirely at the cost of losing SVG reference rendering functionality. Applications relying on the default allowed tags require no action. Review all call sites passing custom 'tags:' arrays to safe_list_sanitize or PermitScrubber to confirm no SVG reference elements are included.

Affected VersionsENISA

rails-html-sanitizer 1.0.3, < 1.7.1

Affected Packages

rubygems rails-html-sanitizer fix: 1.7.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

rails-html-sanitizer is the Ruby gem responsible for sanitizing HTML fragments in Rails applications, internally delegating to Loofah and Nokogiri for DOM-based scrubbing. The PermitScrubber class maintains a safelist 'SVG_ALLOW_LOCAL_HREF' of SVG elements (such as 'use' and 'feImage') that are permitted to carry href-style attributes only when they point to same-document fragment references (values starting with '#'). The flaw (CWE-79) originates from the attribute name check being hard-coded to 'xlink:href', the older XLink namespace form, while the SVG 2 specification introduced the unprefixed 'href' attribute as an equivalent. Loofah's 'SVG_HREF_ATTRIBUTES' collection covers both forms; the fix (commit 74dcb805) replaces the literal string comparison with a membership check against that collection. The companion dependency bump to loofah >= 2.25.2 and crass 1.0.7 reflects a coordinated fix documented in GHSA-9wjq-cp2p-hrgf.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 5.1 MEDIUM
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
vuln.today AI 4.4 MEDIUM

AC:H reflects the non-default configuration prerequisite; PR:L because submitting content typically requires some application access; S:C and UI:R because victim browser action resolves the cross-document SVG reference.

3.1 AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:L/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
SUSE 6.1 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Red Hat 5.4 MEDIUM

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 13, 2026 - 19:04 EUVD

DescriptionCVE.org

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. From 1.0.3 until 1.7.1, Rails::HTML::PermitScrubber restricted SVG reference elements in SVG_ALLOW_LOCAL_HREF only when they used xlink:href, even though browsers also accept the plain href attribute. Applications with non-default allowed tags that included SVG use or feImage elements could therefore permit external references; a same-origin external SVG referenced by use could execute scripts in the sanitized document's context, while feImage could load external images for tracking. Applications using the default allowed tags are not affected. This issue is fixed in version 1.7.1.

Threat Intelligence Overview

EPSS Score
0.4%
Top 67% exploitable
Prevalence
Medium
widely used Rails ecosystem gem, not universal across all stacks
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 16.0 Affected
SUSE Linux Enterprise High Availability Extension 16.1 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy