{"id":"GHSA-jcff-cj73-4w4f","aliases":["CVE-2026-126206"],"title":"Loofah allowed_uri? treats data:text&sol;html as safe text/plain","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"## Summary\n\n`Loofah::HTML5::Scrub.allowed_uri?` returns `true` for a `data:` URI whose mediatype is written with the HTML5 named character reference `&sol;` in place of the solidus. Loofah reads that mediatype as malformed and falls back to the allowed `text/plain`, while a browser decodes the reference and reads the same URI as `text/html`.\n\n## Details\n\n`allowed_uri?` decodes HTML entities with `CGI.unescapeHTML`, which handles numeric character references but not HTML5 named character references. `&sol;` therefore survives normalization, so the mediatype carries no `/`, fails the MIME grammar, and falls back to the allowed `text/plain` under the WHATWG rule for a malformed mediatype.\n\n`&colon;`, `&sol;`, `&Tab;` and `&NewLine;` are the only named character references in the HTML5 table that decode to characters that change how a URI parses (U+003A, U+002F, U+0009 and U+000A; there is no named reference for U+000D), so this closes the set.\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 @ngpestelos.","severity":"medium","score":5.3,"published":"2026-11-12T20:51:36.537Z","modified":"2026-11-13T22:32:32.734Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"RubyGems","name":"loofah","sources":[{"name":"OSV · GHSA-jcff-cj73-4w4f","url":"https://osv.dev/vulnerability/GHSA-jcff-cj73-4w4f"}],"ranges":[{"events":[{"introduced":"2.25.2"},{"fixed":"2.25.3"}],"type":"ECOSYSTEM"}],"versions":["2.25.2"],"fixed":["2.25.3"]}],"sourceAffected":[],"references":["https://github.com/flavorjones/loofah/security/advisories/GHSA-jcff-cj73-4w4f","https://github.com/flavorjones/loofah/pull/324","https://github.com/flavorjones/loofah/commit/ad92002966053309f83b550861e2ef04bc714744","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-jcff-cj73-4w4f.yml"],"sources":[{"name":"OSV","id":"GHSA-jcff-cj73-4w4f","modified":"2026-11-12T21:00:03.782376099Z","url":"https://osv.dev/vulnerability/GHSA-jcff-cj73-4w4f"},{"name":"CVE","id":"CVE-2026-126206","modified":"2026-11-13T22:32:32.734Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-126206"}],"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-126206","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-11-10T20:07:44.958Z","published":"2026-11-12T20:51:36.537Z","modified":"2026-11-13T22:32:32.734Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-11-12T20:51:36.537Z"},{"name":"CISA-ADP","role":"ADP","organizationId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","modified":"2026-11-13T22:32:32.734Z"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-jcff-cj73-4w4f","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/ad92002966053309f83b550861e2ef04bc714744","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":[{"source":"CISA-ADP","type":"SSVC","role":"CISA Coordinator","timestamp":"2026-11-13T16:33:59.076823Z","decisions":[{"name":"Exploitation","value":"none"},{"name":"Automatable","value":"yes"},{"name":"Technical Impact","value":"partial"}]}]},"products":[{"vendor":"flavorjones","name":"loofah","platforms":[],"versions":[{"version":"= 2.25.2","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-126206"}],"remediation":[],"observedAt":"2026-11-13T23:01:42.719Z","kev":{"status":"not-listed","checkedAt":"2026-11-15T04:10:32.324Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-12T23:05:34.787Z","attemptedAt":"2026-11-12T23:05:34.787Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-12T23:05:35.127Z","attemptedAt":"2026-11-12T23:05:35.127Z"},{"source":"EUVD","status":"available","checkedAt":"2026-11-12T23:05:35.334Z","attemptedAt":"2026-11-12T23:05:35.334Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-12T23:05:34.721Z","attemptedAt":"2026-11-12T23:05:34.721Z"}],"evidence":[{"source":"NVD","id":"CVE-2026-126206","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126206","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:05:34.787Z"},{"source":"GitHub Advisory Database","id":"GHSA-jcff-cj73-4w4f","url":"https://github.com/advisories/GHSA-jcff-cj73-4w4f","modified":"2026-11-12T20:56:31Z","checkedAt":"2026-11-12T23:05:35.127Z"},{"source":"ENISA EUVD","id":"EUVD-2026-124712","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-124712","modified":"Nov 12, 2026, 8:51:36 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:05:35.334Z"}],"aiSummary":null}