CVE-2026-68749
JSON

8.2high

Quadratic regex backtracking in the html_sanitize_ex CSS scrubber allows CPU-exhaustion denial of service

Severity
8.2high CVSS:4.0 by EEF
Exploit likelihood
0.48% (higher than 42% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
EEF-CVE-2026-68749GHSA-4cx2-987x-rr2x

Description

Inefficient Regular Expression Complexity vulnerability in the CSS scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to exhaust server CPU via a long CSS declaration in sanitized HTML. The declaration regex in HtmlSanitizeEx.Scrubber.CSS.scrub/1 matches the property name with an unbounded greedy [-\w]+ followed by a mandatory :, so a long run of word characters not followed by a colon makes the engine give back one character at a time and retry the colon at every start offset. The work is quadratic in the length of the run, and no length cap is applied to the CSS handed to the scrubber. An 80 KB <style> body costs roughly 2.4 seconds of scheduler time, so a few concurrent requests saturate the BEAM scheduler pool and make the application unresponsive. The impact is CPU exhaustion only. Nothing is read, modified or disclosed. This issue affects html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.3.

Affected

Product or packageVersionsReported by
html_sanitize_exfrom 0.3.1 before 1.4.5, from 1.5.0-rc.0 before 1.5.3CVE List
rrrene/html_sanitize_exfrom 21f90012eb21aa36f4e3701b7547e12faf0f3c8b before *CVE List
html_sanitize_ex (Hex)from 0.3.1 before 1.4.5, from 1.5.0-rc.0 before 1.5.3Erlang Ecosystem Foundation
https://github.com/rrrene/html_sanitize_exfrom 21f90012eb21aa36f4e3701b7547e12faf0f3c8b before 4f4bd9eb254881462c0461fbab74b29188c2c133, before b673df33ddf982c8bd0a8bd6348aa247080b3b14Erlang Ecosystem Foundation
rrrene htmlsanitizeexfrom 0.3.1 before 1.5.3NVD

All scores

EEF8.2high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Erlang Ecosystem FoundationNot scored CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-1333

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Inefficient Regular Expression Complexity vulnerability in the CSS scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to exhaust server CPU via a long CSS declaration in sanitized HTML. The declaration regex in HtmlSanitizeEx.Scrubber.CSS.scrub/1 matches the property name with an unbounded greedy [-\w]+ followed by a mandatory :, so a long run of word characters not followed by a colon makes the engine give back one character at a time and retry the colon at every start offset. The work is quadratic in the length of the run, and no length cap is applied to the CSS handed to the scrubber. An 80 KB <style> body costs roughly 2.4 seconds of scheduler time, so a few concurrent requests saturate the BEAM scheduler pool and make the application unresponsive. The impact is CPU exhaustion only. Nothing is read, modified or disclosed. This issue affects html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.3.

Erlang Ecosystem Foundation

Summary

Inefficient Regular Expression Complexity vulnerability in the CSS scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to exhaust server CPU via a long CSS declaration in sanitized HTML. The declaration regex in HtmlSanitizeEx.Scrubber.CSS.scrub/1 matches the property name with an unbounded greedy [-\w]+ followed by a mandatory :, so a long run of word characters not followed by a colon makes the engine give back one character at a time and retry the colon at every start offset. The work is quadratic in the length of the run, and no length cap is applied to the CSS handed to the scrubber. An 80 KB <style> body costs roughly 2.4 seconds of scheduler time, so a few concurrent requests saturate the BEAM scheduler pool and make the application unresponsive.

The impact is CPU exhaustion only. Nothing is read, modified or disclosed.

This issue affects html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.3.

Workarounds

Sanitize with basic_html/1, markdown_html/1 or strip_tags/1, none of which reach the CSS scrubber, or define a custom scrubber that allows neither <style> elements nor style attributes.

Capping the size of user-supplied HTML before it reaches the sanitizer bounds the cost, though the quadratic growth means the cap has to be small to be effective.

Configurations

Only HtmlSanitizeEx.html5/1, and custom scrubbers declared with use HtmlSanitizeEx, extend: :html5, route input into the CSS scrubber, by way of <style> element bodies and style attributes. Applications calling HtmlSanitizeEx.Scrubber.CSS.scrub/1 directly are also affected.

NVD (es)

Una vulnerabilidad de complejidad de expresión regular ineficiente en el depurador CSS en rrrene html_sanitize_ex permite a un atacante remoto no autenticado agotar la CPU del servidor a través de una declaración CSS larga en HTML saneado. La expresión regular de declaración en HtmlSanitizeEx.Scrubber.CSS.scrub/1 coincide con el nombre de la propiedad con un [-\w]+ codicioso ilimitado seguido de un : obligatorio, por lo que una secuencia larga de caracteres de palabra no seguida por dos puntos hace que el motor retroceda un carácter a la vez y reintente los dos puntos en cada desplazamiento de inicio. El trabajo es cuadrático en la longitud de la secuencia, y no se aplica ningún límite de longitud al CSS entregado al depurador. Un cuerpo [style] de 80 KB cuesta aproximadamente 2.4 segundos de tiempo de planificador, por lo que unas pocas solicitudes concurrentes saturan el pool de planificadores BEAM y hacen que la aplicación no responda. El impacto es solo agotamiento de CPU. Nada es leído, modificado o divulgado. Este problema afecta a html_sanitize_ex: desde 0.3.1 antes de 1.5.3.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-68749 changed 2026-11-19CVE Terms of Use
Erlang Ecosystem FoundationEEF-CVE-2026-68749 changed 2026-11-25CC-BY-4.0
NVDCVE-2026-68749 changed 2026-11-19Public domain