Loofah allowed_uri? treats javascript: alert(1) as safe
Loofah::HTML5::Scrub.allowed_uri? returns true for a javascript: or vbscript: URI whose scheme is split by a numeric character reference without a trailing semicolon, followed by a character that allowed_uri? strips, such as a space or tab. A browser ends the reference at that character and reads javascript: alert(1) as javascript: alert(1).
Recorded fixes — loofah: 2.25.3. Check your release branch.
Exploitation not established
| Affected range | Recorded fix |
|---|---|
| From 2.25.0 before 2.25.3Ecosystem versions | 2.25.3 |
Version evidence: OSV · GHSA-p9wj-w8xq-vjx6
View original version evidence
{
"ranges": [
{
"events": [
{
"introduced": "2.25.0"
},
{
"fixed": "2.25.3"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.25.0",
"2.25.1",
"2.25.2"
]
}