Read the docs

Cross-site scripting in Loofah URI validation via encoded data URIs

Priority LOW 30CWE-184Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Passive
Attack complexity
Low
Attack requirements
None
Impact type
Cross-site scripting
Confidentiality · integrity · availability
None · None · None
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.

Summary

Loofah 2.25.2 mishandles data URIs in its allowed URI helper, Loofah::HTML5::Scrub. The helper treats a data URI with the named solidus reference / as text/plain, while browsers read it as text/html (CWE-79). An application that renders approved URLs in href can allow cross-site scripting, and Rails::HTML::Sanitizer re-exports the helper. Loofah's default sanitize() path is not affected.

Written with Claude Haiku 5.5 from the sources below · 2026-11-13

Description from the CNA

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference / as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00417 36th percentileScored 2026-11-16
Fix Fixed loofah (RubyGems): 2.25.3

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
Yes
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
flavorjonesloofah= 2.25.2—No fix listedCNA
—loofah (RubyGems)2.25.2 to before 2.25.32.25.3Patch availableGHSA-jcff-cj73-4w4f
  • loofah Vendorflavorjones Affected = 2.25.2 Fixed in — No fix listed CNA
  • loofah (RubyGems) Vendor— Affected 2.25.2 to before 2.25.3 Fixed in 2.25.3 Patch available GHSA-jcff-cj73-4w4f

Remediation

Upgrade loofah to version 2.25.3, the fixed version in RubyGems. The sources list no fixed version for loofah.

Written with Claude Haiku 5.5 from the sources below · 2026-11-13

  • Fix · GHSA-jcff-cj73-4w4f loofah (RubyGems) Fixed in 2.25.3 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

Not affected: 2 products
  • Red Hat 3scale API Management Platform 2
  • Red Hat Satellite 6

Timeline

  1. 2026-11-12 Threatist record created from CVE-2026-126206
  2. 2026-11-12 Alias added: GHSA-jcff-cj73-4w4f
  3. 2026-11-12 Fix available: RubyGems/[email protected] · GHSA-jcff-cj73-4w4f
  4. 2026-11-12 CVSS score added · GHSA-jcff-cj73-4w4f
  5. 2026-11-12 Weakness changed · GHSA-jcff-cj73-4w4f
  6. 2026-11-12 6 new references · GHSA-jcff-cj73-4w4f
  7. 2026-11-13 Affected versions changed · Red Hat
  8. 2026-11-13 CVSS score added · Red Hat
  9. 2026-11-13 CISA SSVC decision points changed

References

  • TI-2022-07573 Inefficient Regular Expression Complexity in Loofah CVSS 3.1HIGH 7.5
  • TI-2022-07575 Uncontrolled Recursion in Loofah CVSS 3.1HIGH 7.5
  • TI-2018-05825 In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in… CVSS 3.0MEDIUM 6.1
  • TI-2026-91016 Regular expression denial of service in Loofah SVG local-reference check CVSS 3.1MEDIUM 5.3
  • TI-2022-07577 Improper neutralization of data URIs allows XSS in rails-html-sanitizer CVSS 3.1MEDIUM 6.1
  • TI-2022-07574 Improper neutralization of data URIs may allow XSS in Loofah CVSS 3.1MEDIUM 6.1
See all 15 →

Sources