Skip to content

Commit 88a5f94

Browse files
1 parent f7ae83f commit 88a5f94

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-2j22-pr5w-6gq8",
4+
"modified": "2026-03-26T22:19:02Z",
5+
"published": "2026-03-26T22:19:02Z",
6+
"aliases": [],
7+
"summary": "Loofah has improper detection of disallowed URIs via `allowed_uri?`",
8+
"details": "## Summary\n\n`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).\n\n## Details\n\nThe `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)`.\n\nNote 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.\n\n## Impact\n\nApplications 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).\n\nThis only affects Loofah `2.25.0`.\n\n## Mitigation\n\nUpgrade to Loofah >= `2.25.1`.\n\n## Credit\n\nResponsibly reported by HackOne user @smlee.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "RubyGems",
19+
"name": "loofah"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "2.25.0"
27+
},
28+
{
29+
"fixed": "2.25.1"
30+
}
31+
]
32+
}
33+
],
34+
"versions": [
35+
"2.25.0"
36+
]
37+
}
38+
],
39+
"references": [
40+
{
41+
"type": "WEB",
42+
"url": "https://github.com/flavorjones/loofah/security/advisories/GHSA-46fp-8f5p-pf2m"
43+
},
44+
{
45+
"type": "WEB",
46+
"url": "https://github.com/flavorjones/loofah/commit/f4ebc9c5193dde759a57541062e490e86fc7c068"
47+
},
48+
{
49+
"type": "PACKAGE",
50+
"url": "https://github.com/flavorjones/loofah"
51+
},
52+
{
53+
"type": "WEB",
54+
"url": "https://github.com/flavorjones/loofah/releases/tag/v2.25.1"
55+
},
56+
{
57+
"type": "WEB",
58+
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-46fp-8f5p-pf2m.yml"
59+
}
60+
],
61+
"database_specific": {
62+
"cwe_ids": [
63+
"CWE-79",
64+
"CWE-116"
65+
],
66+
"severity": "LOW",
67+
"github_reviewed": true,
68+
"github_reviewed_at": "2026-03-26T22:19:02Z",
69+
"nvd_published_at": null
70+
}
71+
}

0 commit comments

Comments
 (0)