🛡️ GHSA-46fp-8f5p-pf2m — loofah
Description
Improper detection of disallowed URIs by Loofah allowed_uri?
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.
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity none, availability none.
Weakness class
GHSA-46fp-8f5p-pf2m is classified as CWE-79: Cross-site Scripting (XSS). User-supplied data is written into a page without escaping, so attacker script runs in the browser of anyone who views it.
Affected software
GHSA-46fp-8f5p-pf2m is recorded against 1 package.
- loofah (from 2.25.0 up to 2.25.1)
Timeline and source
Published on 18 March 2026 and last revised on 23 March 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.
References
Details
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
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| loofah | 2.25.0 | 2.25.1 |
References
Similar Threats
- Low GHSA-5qhf-9phg-95m2
- Low GHSA-8whx-365g-h9vv
- Unknown GHSA-9wjq-cp2p-hrgf
- Low GHSA-2j22-pr5w-6gq8
- High CVE-2022-23514
More GHSA 4 advisories
Browse all of GHSA 4 in the advisory index.
- GHSA-44m4-9cjp-j587
- GHSA-44pg-c29v-hp6r
- GHSA-44px-qjjc-xrhq
- GHSA-45qm-j4m9-whv9
- GHSA-45w3-v3g4-54pm
- GHSA-45wj-jv2h-jwrf
- GHSA-45xg-4w5x-j429
- GHSA-46c5-pfj8-fv65
- GHSA-46h3-79wf-xr6c
- GHSA-46q4-43ph-c6fr
- GHSA-46wh-3698-f2cx
- GHSA-47qc-857f-7w7f
- GHSA-47qw-ccjm-9c2c
- GHSA-47w6-gwp4-w6vc
- GHSA-47wq-cj9q-wpmp
- GHSA-47ww-ff84-4jrg
Free Vulnerability Check
Is your site affected by GHSA-46fp-8f5p-pf2m?
BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-46fp-8f5p-pf2m and other known CVE records.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.