{"id":"CVE-2026-126206","aliases":["EUVD-2026-124712","GHSA-jcff-cj73-4w4f","UBUNTU-CVE-2026-126206"],"status":"published","title":"Loofah allowed_uri? treats data:text\u0026sol;html as safe text/plain","description":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference \u0026sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.","severity":{"version":"4.0","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","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-13","score":0.00417,"percentile":0.36492,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-184","CWE-79"],"published":"2026-11-12T20:51:36Z","modified":"2026-11-13T21:05:24Z","fixes":[{"ecosystem":"RubyGems","package":"loofah","fixed_in":["2.25.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.25.2"},{"last_affected":"2.25.2"},{"fixed":"2.25.3"}]}],"versions":["2.25.2"]},{"source":"osv","ecosystem":"RubyGems","package":"loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.25.2"},{"fixed":"2.25.3"}]}],"versions":["2.25.2"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.0.2-1","2.0.3-1","2.0.3-2","2.0.3-2+deb9u1build0.16.04.1","2.0.3-2+deb9u2build0.16.04.1","2.0.3-2+deb9u3build0.16.04.1"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.0.3-2","2.2.2-1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.3-1","2.3.1+dfsg-1","2.4.0+dfsg-1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.12.0-1","2.13.0-1","2.13.0-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.21.3-1","2.21.4-1","2.22.0-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.25.0-1","2.25.1-2","2.25.2-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"ruby-loofah","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.24.1-1","2.25.0-1"]}],"products":[{"vendor":"flavorjones","product":"loofah"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-jcff-cj73-4w4f","tags":["x_refsource_CONFIRM","advisory","web","report"]},{"url":"https://github.com/flavorjones/loofah/pull/324","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/flavorjones/loofah/commit/ad92002966053309f83b550861e2ef04bc714744","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/flavorjones/loofah/releases/tag/v2.25.3","tags":["x_refsource_MISC","web","report"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-jcff-cj73-4w4f.yml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-jcff-cj73-4w4f"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/126xxx/CVE-2026-126206.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126206","tags":["advisory"]},{"url":"https://github.com/flavorjones/loofah","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-126206","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-126206","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-126206","title":"Loofah allowed_uri? treats data:text\u0026sol;html as safe text/plain","description":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference \u0026sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.","status":"published","published":"2026-11-12T20:51:36.537Z","modified":"2026-11-13T22:32:32.734Z","cvss":[{"version":"4.0","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","level":"medium","assessor":"cna"}],"cwes":["CWE-79","CWE-184"],"updated_at":"2026-11-12T21:48:41.197491Z"}],"euvd":[{"id":"EUVD-2026-124712","description":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference \u0026sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.","status":"published","published":"2026-11-12T20:51:36Z","modified":"2026-11-13T22:32:32Z","cvss":[{"version":"4.0","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","level":"medium"}],"updated_at":"2026-11-12T23:36:13.654761Z"}],"ghsa":[{"id":"GHSA-jcff-cj73-4w4f","title":"Loofah allowed_uri? treats data:text\u0026sol;html as safe text/plain","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 `\u0026sol;` 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. `\u0026sol;` 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`\u0026colon;`, `\u0026sol;`, `\u0026Tab;` and `\u0026NewLine;` 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 \u003e= 2.25.3.\n\n## Credit\n\nResponsibly reported by GitHub user @ngpestelos.","status":"published","published":"2026-11-12T20:56:30Z","modified":"2026-11-12T20:56:31Z","cvss":[{"version":"4.0","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","level":"medium"}],"cwes":["CWE-79","CWE-184"],"updated_at":"2026-11-12T21:13:23.478099Z"}],"nvd":[{"id":"CVE-2026-126206","description":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference \u0026sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.","status":"published","published":"2026-11-12T21:17:21.67Z","modified":"2026-11-13T23:17:15.42Z","cvss":[{"version":"4.0","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","level":"medium","assessor":"secondary"}],"cwes":["CWE-79","CWE-184"],"updated_at":"2026-11-12T23:33:09.696019Z"}],"osv":[{"id":"CVE-2026-126206","title":"Loofah allowed_uri? treats data:text\u0026sol;html as safe text/plain","description":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference \u0026sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.","status":"published","published":"2026-11-12T20:51:36.537Z","modified":"2026-11-14T02:47:26.445716392Z","cvss":[{"version":"4.0","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","level":"medium"}],"cwes":["CWE-184","CWE-79"],"updated_at":"2026-11-14T03:11:13.096066Z"},{"id":"GHSA-jcff-cj73-4w4f","title":"Loofah allowed_uri? treats data:text\u0026sol;html as safe text/plain","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 `\u0026sol;` 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. `\u0026sol;` 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`\u0026colon;`, `\u0026sol;`, `\u0026Tab;` and `\u0026NewLine;` 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 \u003e= 2.25.3.\n\n## Credit\n\nResponsibly reported by GitHub user @ngpestelos.","status":"published","published":"2026-11-12T20:56:30Z","modified":"2026-11-12T21:00:03.782376099Z","cvss":[{"version":"4.0","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","level":"medium"}],"cwes":["CWE-184","CWE-79"],"updated_at":"2026-11-12T21:15:34.287192Z"},{"id":"UBUNTU-CVE-2026-126206","description":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference \u0026sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.","status":"published","published":"2026-11-13T00:00:00Z","modified":"2026-11-13T21:05:24.763481356Z","cvss":[{"version":"4.0","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","level":"medium"}],"updated_at":"2026-11-13T21:30:20.292037Z"}]}}
