{"id":"GHSA-p9wj-w8xq-vjx6","aliases":["CVE-2026-126209"],"title":"Loofah allowed_uri? treats javascript&#x3a alert(1) as safe","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"## Summary\n\n`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&#x3a alert(1)` as `javascript: alert(1)`.\n\n## Details\n\n`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 `&#x3a alert` decodes as `&#x3aa` (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 `&#x6a\\tavascript:alert(1)`.\n\nLoofah's default `sanitize()` path is **not** affected, because Nokogiri decodes the entity during parsing before Loofah evaluates the URI. This issue affects only callers of the public `allowed_uri?` string-level helper that pass it HTML-encoded strings.\n\n## Impact\n\nApplications 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.\n\n## Mitigation\n\nUpgrade to Loofah >= 2.25.3.\n\n## Credit\n\nResponsibly reported by GitHub user @manus-pi.","severity":"medium","score":5.3,"published":"2026-11-12T21:01:58.128Z","modified":"2026-11-12T21:30:03.002Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"RubyGems","name":"loofah","sources":[{"name":"OSV · GHSA-p9wj-w8xq-vjx6","url":"https://osv.dev/vulnerability/GHSA-p9wj-w8xq-vjx6"}],"ranges":[{"events":[{"introduced":"2.25.0"},{"fixed":"2.25.3"}],"type":"ECOSYSTEM"}],"versions":["2.25.0","2.25.1","2.25.2"],"fixed":["2.25.3"]}],"sourceAffected":[],"references":["https://github.com/flavorjones/loofah/security/advisories/GHSA-p9wj-w8xq-vjx6","https://github.com/flavorjones/loofah/pull/324","https://github.com/flavorjones/loofah/commit/62c04841e8252a1b5373afcd2b89fb9b8279e317","https://github.com/flavorjones/loofah","https://github.com/flavorjones/loofah/releases/tag/v2.25.3","https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-p9wj-w8xq-vjx6.yml"],"sources":[{"name":"OSV","id":"GHSA-p9wj-w8xq-vjx6","modified":"2026-11-12T21:30:03.002169937Z","url":"https://osv.dev/vulnerability/GHSA-p9wj-w8xq-vjx6"},{"name":"CVE","id":"CVE-2026-126209","modified":"2026-11-12T21:01:58.128Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-126209"}],"assessments":[{"source":"OSV","vector":"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","score":5.3},{"source":"GitHub_M","vector":"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","score":5.3}],"cve":{"records":[{"id":"CVE-2026-126209","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-11-10T20:07:44.958Z","published":"2026-11-12T21:01:58.128Z","modified":"2026-11-12T21:01:58.128Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-11-12T21:01:58.128Z"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-p9wj-w8xq-vjx6","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/flavorjones/loofah/pull/324","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/flavorjones/loofah/commit/62c04841e8252a1b5373afcd2b89fb9b8279e317","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/flavorjones/loofah/releases/tag/v2.25.3","tags":["x_refsource_MISC"],"source":"GitHub_M"}],"weaknesses":[{"id":"CWE-79","description":"CWE-79: Improper Neutralization of Input During Web Page Generation","source":"GitHub_M"},{"id":"CWE-184","description":"CWE-184: Incomplete List of Disallowed Inputs","source":"GitHub_M"}],"applicability":[],"prioritization":[]},"products":[{"vendor":"flavorjones","name":"loofah","platforms":[],"versions":[{"version":">= 2.25.0, < 2.25.3","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-126209"}],"remediation":[],"observedAt":"2026-11-13T04:34:00.821Z","kev":{"status":"not-listed","checkedAt":"2026-11-15T04:45:31.033Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-12T23:00:41.781Z","attemptedAt":"2026-11-12T23:00:41.781Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-12T23:00:33.971Z","attemptedAt":"2026-11-12T23:00:33.971Z"},{"source":"EUVD","status":"available","checkedAt":"2026-11-12T23:00:33.044Z","attemptedAt":"2026-11-12T23:00:33.044Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-12T23:00:32.744Z","attemptedAt":"2026-11-12T23:00:32.744Z"}],"evidence":[{"source":"ENISA EUVD","id":"EUVD-2026-124716","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-124716","modified":"Nov 12, 2026, 9:01:58 PM","score":5.3,"vector":"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","checkedAt":"2026-11-12T23:00:33.044Z"},{"source":"GitHub Advisory Database","id":"GHSA-p9wj-w8xq-vjx6","url":"https://github.com/advisories/GHSA-p9wj-w8xq-vjx6","modified":"2026-11-12T21:27:46Z","checkedAt":"2026-11-12T23:00:33.971Z"},{"source":"NVD","id":"CVE-2026-126209","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126209","modified":"2026-11-12T22:09:39.233","score":5.3,"vector":"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","checkedAt":"2026-11-12T23:00:41.781Z"}],"aiSummary":null}