{"id":"CVE-2026-73492","aliases":["CVE-2026-73492","GHSA-5qhf-9phg-95m2"],"related":[],"kind":"vulnerability","state":"published","title":"Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons","summary":"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.2, Loofah::HTML5::Scrub.allowed_uri? does not reject javascript: or vbscript: URIs whose scheme is split by semicolon-less numeric character references such as &#58, &#9, &#10, or &#13. CGI.unescapeHTML leaves these references encoded, so allowed_uri? reports the URL safe even though a browser decodes an encoded colon or strips encoded whitespace and executes the resulting URI scheme. This issue affects only callers that pass HTML-encoded strings directly to allowed_uri?; Loofah's default sanitize() path is not affected. This issue is fixed in version 2.25.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.2, Loofah::HTML5::Scrub.allowed_uri? does not reject javascript: or vbscript: URIs whose scheme is split by semicolon-less numeric character references such as &#58, &#9, &#10, or &#13. CGI.unescapeHTML leaves these references encoded, so allowed_uri? reports the URL safe even though a browser decodes an encoded colon or strips encoded whitespace and executes the resulting URI scheme. This issue affects only callers that pass HTML-encoded strings directly to allowed_uri?; Loofah's default sanitize() path is not affected. This issue is fixed in version 2.25.2.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`Loofah::HTML5::Scrub.allowed_uri?` 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 `allowed_uri?` reports it safe.\n\nThis is a bypass of the fix for [GHSA-46fp-8f5p-pf2m](https://github.com/flavorjones/loofah/security/advisories/GHSA-46fp-8f5p-pf2m), which handled numeric character references with a trailing `;` (`&#9;`, `&#10;`, `&#13;`) but did not cover the forms without semicolons.\n\n## Details\n\n`allowed_uri?` decodes HTML entities with `CGI.unescapeHTML`, which decodes numeric character references only when they carry a trailing `;`. A reference without a semicolon such as `&#58` (colon) or `&#9` (tab) is left literal, so the scheme-detection check finds no scheme, and the method falls through to its scheme-less path and returns `true`.\n\nA browser, however, decodes numeric character references even without a trailing semicolon. An encoded colon such as `&#58` becomes the `:` scheme separator, so `javascript&#58alert(1)` resolves to `javascript:alert(1)`. Encoded whitespace such as `&#9` (tab) is decoded and then stripped from the URL, rejoining the surrounding text, so `java&#9script:alert(1)` also resolves to `javascript:alert(1)`. In both cases the URL executes while `allowed_uri?` approved it as safe.\n\nNote that Loofah's default `sanitize()` path is **not** affected, because Nokogiri decodes or entity-escapes HTML entities during parsing before Loofah evaluates the URI protocol. This issue only affects callers of the public `allowed_uri?` string-level helper that pass it HTML-encoded strings.\n\n## Impact\n\nCallers that validate a user-controlled URL with `Loofah::HTML5::Scrub.allowed_uri?` 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 `allowed_uri?` directly, as well as higher-level features built on top of it, such as Action Text 8.2's markdown link validation.\n\n## Mitigation\n\nUpgrade to Loofah >= 2.25.2.\n\n## Credit\n\nResponsibly reported by GitHub user @MoonFuji.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Loofah es una biblioteca general para manipular y transformar documentos y fragmentos HTML/XML, construida sobre Nokogiri. Desde la versión 2.25.0 hasta la 2.25.2, Loofah::HTML5::Scrub.allowed_uri? no rechaza URIs javascript_disabled: o vbscript: cuyo esquema está dividido por referencias de caracteres numéricos sin punto y coma como  y #58,  y #9,  y #10, o  y #13. CGI.unescapeHTML deja estas referencias codificadas, por lo que allowed_uri? informa que la URL es segura a pesar de que un navegador decodifica un colon codificado o elimina espacios en blanco codificados y ejecuta el esquema URI resultante. Este problema afecta solo a los llamadores que pasan cadenas codificadas en HTML directamente a allowed_uri?; la ruta sanitize() predeterminada de Loofah no se ve afectada. Este problema está solucionado en la versión 2.25.2.","source":"nvd"}],"published":"2026-07-21T22:03:11.000Z","modified":"2026-10-24T15:10:00.190Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":2.3,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":2.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"LOW"}],"cwes":["CWE-79","CWE-184"],"affected":[{"ranges":[{"version":">= 2.25.0, < 2.25.2","status":"affected"}],"vendor":"flavorjones","product":"loofah","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.25.0","status":"affected","fixed":"2.25.2"}],"ecosystem":"RubyGems","package":"loofah","purl":"pkg:gem/loofah","source":"ghsa"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-5qhf-9phg-95m2","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/flavorjones/loofah/pull/308","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/flavorjones/loofah/commit/f1be9d893b5a8dd79240441a912d8897e74c38c0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/flavorjones/loofah/releases/tag/v2.25.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/flavorjones/loofah","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-14T22:17:58.982Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-73492","url":"https://www.cve.org/CVERecord?id=CVE-2026-73492","licence":"CVE Terms of Use","modified":"2026-08-14T22:18:10.839Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5qhf-9phg-95m2","url":"https://github.com/advisories/GHSA-5qhf-9phg-95m2","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:10.544Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-73492","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-73492","licence":"Public domain","modified":"2026-10-24T15:10:00.190Z"}],"updatedAt":"2026-11-25T22:59:32.669Z","epss":{"score":0.00245,"percentile":0.16819,"date":"2026-12-01T12:00:22.000Z"}}