Ruby/loofah/2.25.1
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri.
Loofah also includes some HTML sanitizers based on html5lib's safelist, which are a specific application of the general transformation functionality.
https://rubygems.org/gems/loofah
MIT
3 Security Vulnerabilities
Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons
Summary
Loofah::HTML5::Scrub.alloweduri? does not correctly reject javascript: or vbscript: URIs when the scheme is split by a numeric character reference that has no trailing semicolon. A browser decodes such references and resolves the URL to an executable javascript: scheme, while alloweduri? reports it safe.
This is a bypass of the fix for GHSA-46fp-8f5p-pf2m, which handled numeric character references with a trailing ; ( , , ) but did not cover the forms without semicolons.
Impact
Callers that validate a user-controlled URL with Loofah::HTML5::Scrub.alloweduri? and then render the approved value into an href or other browser-interpreted URI attribute may be vulnerable to cross-site scripting (XSS). This includes applications that call alloweduri? directly, as well as higher-level features built on top of it, such as Action Text 8.2's markdown link validation.
Credit
Responsibly reported by GitHub user @MoonFuji.
Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references
Summary
Loofah::HTML5::Scrub.allowed_uri? does not correctly reject javascript: URIs when the scheme is split or prefixed by the HTML5 named character references 	 (tab) or 
 (line feed).
This is a bypass of the fix for GHSA-46fp-8f5p-pf2m, which handled the equivalent numeric character references ( , , ) but did not cover the named forms.
SVG `href` attribute bypasses local-reference restriction in Loofah
Summary
Loofah's HTML5 sanitizer restricted only the xlink:href attribute on certain SVG elements to local, same-document references. Browsers also accept a plain href attribute as an alternative to the deprecated xlink:href per the SVG 2 spec, but Loofah did not apply the same restriction to it, allowing those elements to reference arbitrary external documents.
Impact
SVG
Applications that sanitize user-supplied SVG (directly, or as part of HTML) with Loofah's default allowlist are affected.
Credit
Found by the maintainer, Mike Dalessio, during a security audit.
65 Other Versions
| Version | License | Security | Released | |
|---|---|---|---|---|
| 1.0.0 | UNKNOWN | 9 | 2010-10-26 - 04:52 | almost 16 years |
| 1.0.0.beta.1 | UNKNOWN | 9 | 2010-07-21 - 06:56 | about 16 years |
| 0.4.7 | UNKNOWN | 9 | 2010-03-09 - 20:47 | over 16 years |
| 0.4.6 | UNKNOWN | 9 | 2010-02-02 - 14:54 | over 16 years |
| 0.4.5 | UNKNOWN | 10 | 2010-02-02 - 12:27 | over 16 years |
| 0.4.4 | UNKNOWN | 10 | 2010-02-01 - 21:59 | over 16 years |
| 0.4.3 | UNKNOWN | 10 | 2010-01-31 - 20:18 | over 16 years |
| 0.4.2 | UNKNOWN | 10 | 2010-01-24 - 03:54 | over 16 years |
| 0.4.1 | UNKNOWN | 10 | 2009-11-23 - 12:17 | almost 17 years |
| 0.4.0 | UNKNOWN | 10 | 2009-11-22 - 03:59 | almost 17 years |
| 0.3.1 | UNKNOWN | 10 | 2009-10-13 - 06:15 | almost 17 years |
| 0.3.0 | UNKNOWN | 10 | 2009-10-07 - 10:38 | almost 17 years |
| 0.2.2 | UNKNOWN | 10 | 2009-09-24 - 22:14 | almost 17 years |
| 0.2.1 | UNKNOWN | 10 | 2009-08-20 - 05:39 | about 17 years |
| 0.2.0 | UNKNOWN | 10 | 2009-08-18 - 05:20 | about 17 years |
