Loofah URI scrubber accepts encoded javascript and vbscript schemes
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 from 2.25.0 before 2.25.3 has an incomplete list of disallowed inputs in its URI check. The helper strips whitespace and control characters before decoding a semicolon-less numeric character reference, which hides a javascript: or vbscript: scheme from the check. An application that renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting, and Rails::HTML::Sanitizer re-exports the affected helper. Loofah's default sanitize() path is not affected.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
Description from the CNA
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. From 2.25.0 until 2.25.3, Loofah::HTML5::Scrub.allowed_uri? strips whitespace and control characters before decoding a semicolon-less numeric character reference, changing where the reference ends and hiding a javascript: or vbscript: scheme that a browser reconstructs. The bypass applies to encoded colons and encoded scheme letters when a stripped character terminates the numeric reference. An application that renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting, and Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes entities before URI evaluation. This issue is fixed in version 2.25.3.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| flavorjones | loofah | 2.25.0 to before 2.25.3 | 2.25.3 | Patch available | CNA |
| — | loofah (RubyGems) | 2.25.0 to before 2.25.3 | 2.25.3 | Patch available | GHSA-p9wj-w8xq-vjx6 |
- loofah Vendorflavorjones Affected 2.25.0 to before 2.25.3 Fixed in 2.25.3 Patch available CNA
- loofah (RubyGems) Vendor— Affected 2.25.0 to before 2.25.3 Fixed in 2.25.3 Patch available GHSA-p9wj-w8xq-vjx6
Remediation
Upgrade Loofah to version 2.25.3 for the flavorjones loofah package and the RubyGems loofah package. The sources list no fixed version for Rails::HTML::Sanitizer.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
- Fix · CNA loofah (flavorjones) Fixed in 2.25.3
- Fix · GHSA-p9wj-w8xq-vjx6 loofah (RubyGems) Fixed in 2.25.3 Advisory →
Timeline
- 2026-11-12 Threatist record created from CVE-2026-126209
- 2026-11-12 Alias added: GHSA-p9wj-w8xq-vjx6
- 2026-11-12 Fix available: RubyGems/[email protected] · GHSA-p9wj-w8xq-vjx6
- 2026-11-12 CVSS score added · GHSA-p9wj-w8xq-vjx6
- 2026-11-12 Weakness changed · GHSA-p9wj-w8xq-vjx6
- 2026-11-12 6 new references · GHSA-p9wj-w8xq-vjx6
- 2026-11-16 CISA SSVC decision points changed
References
Other 6
- https://github.com/flavorjones/loofah/security/advisories/GHSA-p9wj-w8xq-vjx6
- https://github.com/flavorjones/loofah/pull/324
- https://github.com/flavorjones/loofah/commit/62c04841e8252a1b5373afcd2b89fb9b8279e317
- https://github.com/flavorjones/loofah/releases/tag/v2.25.3
- https://github.com/flavorjones/loofah
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-p9wj-w8xq-vjx6.yml
More flavorjones vulnerabilities
- 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-91019 Cross-site scripting in Loofah URI validation via encoded data URIs CVSS 4.0MEDIUM 5.3
- 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
Sources
- CVE-2026-126209 · CVE Program
- CVE-2026-126209 · NVD
- FIRST EPSS
- GHSA-p9wj-w8xq-vjx6 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences