Loading...
Skip to main content

GHSA-46fp-8f5p-pf2m — Vulnerability in loofah — Advisory Details

LOW

Improper detection of disallowed URIs by Loofah `allowed_uri?`

Published March 18, 2026Updated September 10, 2026Source: osv

Summary

## Summary `Loofah::HTML5::Scrub.allowed_uri?` does not correctly reject `javascript:` URIs when the scheme is split by HTML entity-encoded control characters such as `
` (carriage return), `
` (line feed), or `	` (tab). ## Details The `allowed_uri?` method strips literal control characters before decoding HTML entities. Payloads like `java
script:alert(1)` survive the control character strip, then `
` is decoded to a carriage return, producing `java\rscript:alert(1)`. Note that the Loofah sanitizer's default `sanitize()` path is **not affected** because Nokogiri decodes HTML entities during parsing before Loofah evaluates the URI protocol. This issue only affects direct callers of the `allowed_uri?` string-level helper when passing HTML-encoded strings. ## Impact Applications that call `Loofah::HTML5::Scrub.allowed_uri?` to validate user-controlled URLs and then render approved URLs into `href` or other browser-interpreted URI attributes may be vulnerable to cross-site scripting (XSS). This only affects Loofah `2.25.0`. ## Mitigation Upgrade to Loofah >= `2.25.1`. ## Credit Responsibly reported by HackOne user `@smlee`.

Advisory Timeline

  • First published March 18, 2026 (208 days ago).
  • Last revised September 10, 2026 — 175 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update loofah to 2.25.1 or later
gem install loofah -v 2.25.1

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
loofah
rubygems
2.25.02.25.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.2 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U

Frequently Asked Questions

What is GHSA-46fp-8f5p-pf2m?
Improper detection of disallowed URIs by Loofah `allowed_uri?` This vulnerability has been assigned a severity rating of LOW (CVSS score: 7.2/10).
How do I check if my project is affected by GHSA-46fp-8f5p-pf2m?
GHSA-46fp-8f5p-pf2m affects loofah. Use GeekWala's free vulnerability scanner to check your dependencies against GHSA-46fp-8f5p-pf2m and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.2

High exploitability or significant impact. Prioritize remediation within days.

Related CVEs

  • CVE-2022-23516
    HIGH

    Uncontrolled Recursion in Loofah

  • CVE-2022-23514
    HIGH

    Inefficient Regular Expression Complexity in Loofah

  • CVE-2022-23515
    MEDIUM

    Improper neutralization of data URIs may allow XSS in Loofah

  • CVE-2026-73490
    MEDIUM

    Loofah: SVG `href` attribute bypasses local-reference restriction

  • CVE-2026-54619
    LOW

    sqlite3-ruby has Use-After-Free When Redefining SQLite Functions with Different Arity

  • CVE-2026-73492
    LOW

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons

  • CVE-2026-73491
    LOW

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references

  • CVE-2026-54620
    LOW

    sqlite3-ruby has Use-After-Free in SQLite Aggregate Function Callbacks

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies