4.8medium
html_sanitize_ex HTML5 scrubber keeps attacker-supplied form-association attributes, allowing form hijacking
- Severity
- 4.8medium CVSS:4.0 by EEF
- Exploit likelihood
- 0.29% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- EEF
- Also known as
- EEF-CVE-2026-66370GHSA-w3f9-jjhw-wwvq
Description
URL Redirection to Untrusted Site ('Open Redirect') vulnerability in the HTML5 scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to retarget a form already on the rendering page and receive whatever the victim submits, including credentials, via the form and formaction attributes on an <input> element in sanitized HTML. HTML's form attribute associates an input with any form on the page by its id even when the input sits outside that form, and formaction on a submit control overrides the owning form's action. Neither attribute receives a scheme check, so an absolute cross-origin URL survives sanitizing. No script executes. The scrubber allows neither form nor button, so the attacker cannot introduce a form of their own and the rendering page must already contain a form carrying an id. 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 package | Versions | Reported by |
|---|---|---|
| html_sanitize_ex | from 0.3.1 before 1.4.5, from 1.5.0-rc.0 before 1.5.3 | CVE List |
| rrrene/html_sanitize_ex | from 8976d64ea0b77d26093a94a43ec48a3978e8d028 before * | CVE List |
| html_sanitize_ex (Hex) | from 0.3.1 before 1.4.5, from 1.5.0-rc.0 before 1.5.3 | Erlang Ecosystem Foundation |
| https://github.com/rrrene/html_sanitize_ex | from 8976d64ea0b77d26093a94a43ec48a3978e8d028 before 21394e758cb0ffe12fb9953c30fdedc6016c8f9e, before a1e804ed997e780ea71d14393cf2f701330553a6 | Erlang Ecosystem Foundation |
| rrrene htmlsanitizeex | from 0.3.1 before 1.5.3 | NVD |
All scores
| EEF | 4.8medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N |
| Erlang Ecosystem Foundation | Not scored CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
URL Redirection to Untrusted Site ('Open Redirect') vulnerability in the HTML5 scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to retarget a form already on the rendering page and receive whatever the victim submits, including credentials, via the form and formaction attributes on an <input> element in sanitized HTML. HTML's form attribute associates an input with any form on the page by its id even when the input sits outside that form, and formaction on a submit control overrides the owning form's action. Neither attribute receives a scheme check, so an absolute cross-origin URL survives sanitizing. No script executes. The scrubber allows neither form nor button, so the attacker cannot introduce a form of their own and the rendering page must already contain a form carrying an id. 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
URL Redirection to Untrusted Site ('Open Redirect') vulnerability in the HTML5 scrubber in rrrene html_sanitize_ex allows an unauthenticated remote attacker to retarget a form already on the rendering page and receive whatever the victim submits, including credentials, via the form and formaction attributes on an <input> element in sanitized HTML. HTML's form attribute associates an input with any form on the page by its id even when the input sits outside that form, and formaction on a submit control overrides the owning form's action. Neither attribute receives a scheme check, so an absolute cross-origin URL survives sanitizing.
No script executes. The scrubber allows neither form nor button, so the attacker cannot introduce a form of their own and the rendering page must already contain a form carrying an id.
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 allow input, or define a custom scrubber that omits it.
Omitting the id attribute from the page's own forms, or giving them values an attacker cannot predict, removes the anchor the injected form attribute needs.
Configurations
Only HtmlSanitizeEx.html5/1, and custom scrubbers declared with use HtmlSanitizeEx, extend: :html5, allow the input element, and the sanitized output must be rendered to other users.
The rendering page must also contain a form with an id, since that id is what the injected form attribute binds to.
NVD (es)
La vulnerabilidad de redirección de URL a sitio no confiable (’redirección abierta’) en el depurador HTML5 en rrrene html_sanitize_ex permite a un atacante remoto no autenticado redirigir un formulario ya presente en la página de renderizado y recibir lo que la víctima envíe, incluidas las credenciales, a través de los atributos form y formaction en un elemento [input] en HTML saneado. El atributo form de HTML asocia una entrada con cualquier formulario en la página por su id incluso cuando la entrada se encuentra fuera de ese formulario, y formaction en un control de envío anula la acción del formulario propietario. Ninguno de los atributos recibe una verificación de esquema, por lo que una URL absoluta de origen cruzado sobrevive al saneamiento. No se ejecuta ningún script. El depurador no permite ni form ni button, por lo que el atacante no puede introducir un formulario propio y la página de renderizado ya debe contener un formulario con un id. Este problema afecta a html_sanitize_ex: desde 0.3.1 antes de 1.5.3.
References
| https://github.com/rrrene/html_sanitize_ex/security/advisories/GHSA-w3f9-jjhw-wwvq | advisory, broken-link, related, vendor-advisory | |
| https://cna.erlef.org/cves/CVE-2026-66370.html | patch, related, third-party-advisory, web | |
| https://osv.dev/vulnerability/EEF-CVE-2026-66370 | patch, related, third-party-advisory | |
| https://github.com/rrrene/html_sanitize_ex/commit/8976d64ea0b77d26093a94a43ec48a3978e8d028 | related, web | |
| https://github.com/rrrene/html_sanitize_ex/commit/21394e758cb0ffe12fb9953c30fdedc6016c8f9e | fix, patch | |
| https://github.com/rrrene/html_sanitize_ex/commit/a1e804ed997e780ea71d14393cf2f701330553a6 | fix, patch | |
| https://hex.pm/packages/html_sanitize_ex | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-66370 changed 2026-11-20 | CVE Terms of Use |
| Erlang Ecosystem Foundation | EEF-CVE-2026-66370 changed 2026-11-25 | CC-BY-4.0 |
| NVD | CVE-2026-66370 changed 2026-11-20 | Public domain |