{"id":"CVE-2026-68747","state":"PUBLISHED","title":"CSS sanitizer allowlist bypass in html_sanitize_ex via non-declaration input","description":"Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') vulnerability in the CSS scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to inject CSS at-rules, including an import of a remote stylesheet, into a page served to other users. HtmlSanitizeEx.Scrubber.CSS.scrub/1 applies its property and value allowlist through a Regex.replace over substrings matching a property: value declaration pattern, so input that does not match that pattern is never inspected and is copied to the output unchanged. @import url(//attacker.example/style.css); survives, while the same URL inside a background: url(...) declaration is removed.\n\nElement boundaries are resolved before the scrubber runs, so injected content does not escape the <style> element and no script executes.\n\nThis issue affects html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.4.","publishedAt":"2026-08-06T14:50:03.143Z","updatedAt":"2026-08-19T11:50:10.843Z","severity":{"score":2.3,"label":"Low","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","source":"EEF"},"assigner":"EEF","products":["rrrene html_sanitize_ex"],"affected":[{"vendor":"rrrene","product":"html_sanitize_ex","packageName":"html_sanitize_ex","packageURL":"pkg:hex/html_sanitize_ex","defaultStatus":"unaffected","versions":[{"version":"0.3.1","status":"affected","lessThan":"1.4.5","versionType":"semver"},{"version":"1.5.0-rc.0","status":"affected","lessThan":"1.5.4","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.HtmlSanitizeEx.Scrubber.CSS'","'Elixir.HtmlSanitizeEx'"],"programFiles":["lib/html_sanitize_ex/scrubber/css.ex","lib/html_sanitize_ex.ex"],"programRoutines":[{"name":"'Elixir.HtmlSanitizeEx.Scrubber.CSS':scrub/1"},{"name":"'Elixir.HtmlSanitizeEx':html5/1"}],"repo":"https://github.com/rrrene/html_sanitize_ex"},{"vendor":"rrrene","product":"html_sanitize_ex","packageName":"rrrene/html_sanitize_ex","packageURL":"pkg:github/rrrene/html_sanitize_ex","defaultStatus":"unaffected","versions":[{"version":"21f90012eb21aa36f4e3701b7547e12faf0f3c8b","status":"affected","lessThan":"*","changes":[{"at":"0b9f9ad63a7529d4f2c3c1134c371adc3e654308","status":"unaffected"},{"at":"c311a499db0b0baef06493fb3cfeb730c0f18f28","status":"unaffected"}],"versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.HtmlSanitizeEx.Scrubber.CSS'","'Elixir.HtmlSanitizeEx'"],"programFiles":["lib/html_sanitize_ex/scrubber/css.ex","lib/html_sanitize_ex.ex"],"programRoutines":[{"name":"'Elixir.HtmlSanitizeEx.Scrubber.CSS':scrub/1"},{"name":"'Elixir.HtmlSanitizeEx':html5/1"}],"repo":"https://github.com/rrrene/html_sanitize_ex"}],"references":["https://github.com/rrrene/html_sanitize_ex/security/advisories/GHSA-87v2-pfhj-r5x7","https://cna.erlef.org/cves/CVE-2026-68747.html","https://osv.dev/vulnerability/EEF-CVE-2026-68747","https://github.com/rrrene/html_sanitize_ex/commit/0b9f9ad63a7529d4f2c3c1134c371adc3e654308","https://github.com/rrrene/html_sanitize_ex/commit/c311a499db0b0baef06493fb3cfeb730c0f18f28"],"weaknesses":["CWE-74"],"ingestedAt":"2026-10-29T20:12:49.727Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/68xxx/CVE-2026-68747.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-68747","state":"PUBLISHED","datePublished":"2026-08-06T14:50:03.143Z","dateUpdated":"2026-08-19T11:50:10.843Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-07-31T13:23:00.355Z"},"containers":{"cna":{"title":"CSS sanitizer allowlist bypass in html_sanitize_ex via non-declaration input","descriptions":[{"lang":"en","value":"Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') vulnerability in the CSS scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to inject CSS at-rules, including an import of a remote stylesheet, into a page served to other users. HtmlSanitizeEx.Scrubber.CSS.scrub/1 applies its property and value allowlist through a Regex.replace over substrings matching a property: value declaration pattern, so input that does not match that pattern is never inspected and is copied to the output unchanged. @import url(//attacker.example/style.css); survives, while the same URL inside a background: url(...) declaration is removed.\n\nElement boundaries are resolved before the scrubber runs, so injected content does not escape the <style> element and no script executes.\n\nThis issue affects html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.4."}],"affected":[{"vendor":"rrrene","product":"html_sanitize_ex","packageName":"html_sanitize_ex","packageURL":"pkg:hex/html_sanitize_ex","defaultStatus":"unaffected","versions":[{"version":"0.3.1","status":"affected","lessThan":"1.4.5","versionType":"semver"},{"version":"1.5.0-rc.0","status":"affected","lessThan":"1.5.4","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.HtmlSanitizeEx.Scrubber.CSS'","'Elixir.HtmlSanitizeEx'"],"programFiles":["lib/html_sanitize_ex/scrubber/css.ex","lib/html_sanitize_ex.ex"],"programRoutines":[{"name":"'Elixir.HtmlSanitizeEx.Scrubber.CSS':scrub/1"},{"name":"'Elixir.HtmlSanitizeEx':html5/1"}],"repo":"https://github.com/rrrene/html_sanitize_ex"},{"vendor":"rrrene","product":"html_sanitize_ex","packageName":"rrrene/html_sanitize_ex","packageURL":"pkg:github/rrrene/html_sanitize_ex","defaultStatus":"unaffected","versions":[{"version":"21f90012eb21aa36f4e3701b7547e12faf0f3c8b","status":"affected","lessThan":"*","changes":[{"at":"0b9f9ad63a7529d4f2c3c1134c371adc3e654308","status":"unaffected"},{"at":"c311a499db0b0baef06493fb3cfeb730c0f18f28","status":"unaffected"}],"versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.HtmlSanitizeEx.Scrubber.CSS'","'Elixir.HtmlSanitizeEx'"],"programFiles":["lib/html_sanitize_ex/scrubber/css.ex","lib/html_sanitize_ex.ex"],"programRoutines":[{"name":"'Elixir.HtmlSanitizeEx.Scrubber.CSS':scrub/1"},{"name":"'Elixir.HtmlSanitizeEx':html5/1"}],"repo":"https://github.com/rrrene/html_sanitize_ex"}],"references":[{"url":"https://github.com/rrrene/html_sanitize_ex/security/advisories/GHSA-87v2-pfhj-r5x7","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-68747.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-68747","tags":["related"]},{"url":"https://github.com/rrrene/html_sanitize_ex/commit/0b9f9ad63a7529d4f2c3c1134c371adc3e654308","tags":["patch"]},{"url":"https://github.com/rrrene/html_sanitize_ex/commit/c311a499db0b0baef06493fb3cfeb730c0f18f28","tags":["patch"]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":2.3,"baseSeverity":"LOW","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"LOW","subIntegrityImpact":"LOW","userInteraction":"PASSIVE","valueDensity":"NOT_DEFINED","vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","version":"4.0","vulnAvailabilityImpact":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-74","description":"CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-08-19T11:50:10.843Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Only <code>HtmlSanitizeEx.html5/1</code>, and custom scrubbers declared with <code>use HtmlSanitizeEx, extend: :html5</code>, permit <code>&lt;style&gt;</code> elements, and the sanitized output must be rendered to other users. Applications calling <code>HtmlSanitizeEx.Scrubber.CSS.scrub/1</code> directly are also affected.</p>"},{"base64":false,"type":"text/markdown","value":"Only `HtmlSanitizeEx.html5/1`, and custom scrubbers declared with `use HtmlSanitizeEx, extend: :html5`, permit `<style>` elements, and the sanitized output must be rendered to other users. Applications calling `HtmlSanitizeEx.Scrubber.CSS.scrub/1` directly are also affected."}],"value":"Only HtmlSanitizeEx.html5/1, and custom scrubbers declared with use HtmlSanitizeEx, extend: :html5, permit <style> elements, and the sanitized output must be rendered to other users. Applications calling HtmlSanitizeEx.Scrubber.CSS.scrub/1 directly are also affected."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*","versionEndExcluding":"1.4.5","versionStartIncluding":"0.3.1","vulnerable":true},{"criteria":"cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*","versionEndExcluding":"1.5.4","versionStartIncluding":"1.5.0-rc.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"remediation developer","value":"René Föhring"}],"impacts":[{"capecId":"CAPEC-148","descriptions":[{"lang":"en","value":"CAPEC-148 Content Spoofing"}]}],"source":{"discovery":"EXTERNAL"},"workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Sanitize with <code>basic_html/1</code>, <code>markdown_html/1</code> or <code>strip_tags/1</code>, none of which allow <code>&lt;style&gt;</code> elements, or define a custom scrubber that omits it.</p>\n<p>A Content-Security-Policy <code>style-src</code> directive that permits no external stylesheet origins stops an injected <code>@import</code> from loading, though injected inline rules still apply.</p>"},{"base64":false,"type":"text/markdown","value":"Sanitize with `basic_html/1`, `markdown_html/1` or `strip_tags/1`, none of which allow `<style>` elements, or define a custom scrubber that omits it.\n\nA Content-Security-Policy `style-src` directive that permits no external stylesheet origins stops an injected `@import` from loading, though injected inline rules still apply."}],"value":"Sanitize with basic_html/1, markdown_html/1 or strip_tags/1, none of which allow <style> elements, or define a custom scrubber that omits it.\n\nA Content-Security-Policy style-src directive that permits no external stylesheet origins stops an injected @import from loading, though injected inline rules still apply."}]},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-06T15:43:31.189847Z","id":"CVE-2026-68747","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-06T15:43:37.237Z"}}]}}}