LOOFAH · CVE-2026-126209 · Package
FIX → 2.25.3
Loofah's allowed_uri? helper accepts javascript: and vbscript: URLs when the scheme is hidden in a numeric character reference without a semicolon, followed by a space or tab. If an application renders that approved value into an href, a browser runs the script, which is cross-site scripting.
first public Nov 2, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications that call Loofah::HTML5::Scrub.allowed_uri? (or Rails::HTML::Sanitizer.allowed_uri?) on user-supplied URLs and then output the result into a link or other browser-interpreted URI attribute. The advisory says Loofah's default sanitize() path is not affected, so apps that only use sanitize() can skip it.
Not affected if default-sanitize-only, no-allowed_uri-calls
Who cares loofah, rails, ruby, web-apps
loofah and note the version.allowed_uri? (Loofah::HTML5::Scrub or Rails::HTML::Sanitizer) whose results are placed in href or other URI attributes.sanitize() use is not affected according to the advisory.Upgrade to 2.25.3
2.25.3 (affected range )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).
allowed_uri? strips control characters and whitespace before it decodes numeric character references. Removing the character that ends a semicolon-less reference lets the reference run on into the following text, so : alert decodes as Ϊ (U+03AA) instead of a colon, and no scheme is detected. The same applies to decimal references and to references that encode a scheme letter, as in j\tavascript:alert(1).
Loofah's default path is affected, because Nokogiri decodes the entity during parsing before Loofah evaluates the URI. This issue affects only callers of the public string-level helper that pass it HTML-encoded strings.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
>= 2.25.0, < 2.25.3sanitize()allowed_uri?Applications that validate a user-controlled URL with Loofah::HTML5::Scrub.allowed_uri? and then render the approved value into an href or another browser-interpreted URI attribute may be vulnerable to cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the same helper.
Upgrade to Loofah >= 2.25.3.
Responsibly reported by GitHub user @manus-pi.
This page as .md · .json · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.