CVE-2026-58228
JSON

5.1medium

Scheme validation bypass in Phoenix.LiveView.Utils leads to XSS via <.link>

Severity
5.1medium CVSS:4.0 by EEF
Exploit likelihood
0.47% (higher than 42% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
EEF-CVE-2026-58228GHSA-5cgh-g58j-m9cq

Description

Cross-site scripting vulnerability in phoenixframework phoenix_live_view allows an attacker to bypass URL scheme validation and execute JavaScript in a victim's browser session. The Phoenix.LiveView.Utils.valid_destination!/2 and Phoenix.LiveView.Utils.valid_live_navigation_destination!/2 functions in lib/phoenix_live_view/utils.ex rely on an internal uri_scheme/1 helper that only detects a scheme when the input's first byte is an ASCII letter. Inputs beginning with an ASCII control character or space fall through to a nil-returning clause, causing the URL to be treated as a safe relative path. Standard browsers implement the WHATWG URL parser, which strips leading C0 control and space characters before parsing. As a result, an input such as " javascript:alert(1)" is passed unchanged into <.link href={...}> and, when clicked, is parsed by the browser as a javascript: URL that executes attacker-controlled script in the victim's session. Applications that render user-supplied URLs (for example profile links, redirect targets, or external references) via <.link href={...}> are affected. This issue affects phoenix_live_view: from 1.2.2 before 1.2.7.

Affected

Product or packageVersionsReported by
phoenix_live_viewfrom 1.2.2 before 1.2.7CVE List
phoenixframework/phoenix_live_viewfrom 4b63216ae68886db99cf7772af23372d76c40e7e before 86165533e311469a1b62093fd182d9d874de8106CVE List
phoenix_live_view (Hex)from 1.2.2 before 1.2.7Erlang Ecosystem Foundation
https://github.com/phoenixframework/phoenix_live_viewfrom 4b63216ae68886db99cf7772af23372d76c40e7e before 86165533e311469a1b62093fd182d9d874de8106Erlang Ecosystem Foundation

All scores

EEF5.1medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:H/SI:H/SA:N
Erlang Ecosystem FoundationNot scored CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:H/SI:H/SA:N

Classification

CWE-79

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

What each source says

CVE List

Cross-site scripting vulnerability in phoenixframework phoenix_live_view allows an attacker to bypass URL scheme validation and execute JavaScript in a victim's browser session. The Phoenix.LiveView.Utils.valid_destination!/2 and Phoenix.LiveView.Utils.valid_live_navigation_destination!/2 functions in lib/phoenix_live_view/utils.ex rely on an internal uri_scheme/1 helper that only detects a scheme when the input's first byte is an ASCII letter. Inputs beginning with an ASCII control character or space fall through to a nil-returning clause, causing the URL to be treated as a safe relative path. Standard browsers implement the WHATWG URL parser, which strips leading C0 control and space characters before parsing. As a result, an input such as " javascript:alert(1)" is passed unchanged into <.link href={...}> and, when clicked, is parsed by the browser as a javascript: URL that executes attacker-controlled script in the victim's session. Applications that render user-supplied URLs (for example profile links, redirect targets, or external references) via <.link href={...}> are affected. This issue affects phoenix_live_view: from 1.2.2 before 1.2.7.

Erlang Ecosystem Foundation

Summary

Cross-site scripting vulnerability in phoenixframework phoenix_live_view allows an attacker to bypass URL scheme validation and execute JavaScript in a victim's browser session.

The Phoenix.LiveView.Utils.valid_destination!/2 and Phoenix.LiveView.Utils.valid_live_navigation_destination!/2 functions in lib/phoenix_live_view/utils.ex rely on an internal uri_scheme/1 helper that only detects a scheme when the input's first byte is an ASCII letter. Inputs beginning with an ASCII control character or space fall through to a nil-returning clause, causing the URL to be treated as a safe relative path.

Standard browsers implement the WHATWG URL parser, which strips leading C0 control and space characters before parsing. As a result, an input such as " javascript:alert(1)" is passed unchanged into <.link href={...}> and, when clicked, is parsed by the browser as a javascript: URL that executes attacker-controlled script in the victim's session.

Applications that render user-supplied URLs (for example profile links, redirect targets, or external references) via <.link href={...}> are affected.

This issue affects phoenix_live_view: from 1.2.2 before 1.2.7.

Workarounds

Strip leading ASCII control and space bytes (code points 0x00 through 0x20) from any untrusted URL before passing it to <.link href={...}>, or reject such inputs outright. This aligns application-level validation with the WHATWG URL parser used by browsers and prevents the scheme-detection bypass.

NVD (es)

Una vulnerabilidad de cross-site scripting en phoenixframework phoenix_live_view permite a un atacante eludir la validación del esquema de URL y ejecutar JavaScript en la sesión del navegador de una víctima. Las funciones Phoenix.LiveView.Utils.valid_destination!/2 y Phoenix.LiveView.Utils.valid_live_navigation_destination!/2 en lib/phoenix_live_view/utils.ex dependen de una función auxiliar interna uri_scheme/1 que solo detecta un esquema cuando el primer byte de la entrada es una letra ASCII. Las entradas que comienzan con un carácter de control ASCII o un espacio pasan a una cláusula que devuelve nil, lo que hace que la URL sea tratada como una ruta relativa segura. Los navegadores estándar implementan el analizador de URL WHATWG, que elimina los caracteres de control C0 y los espacios iniciales antes de analizar. Como resultado, una entrada como ’ javascript_disabled: alert(1)’ se pasa sin cambios a <.link href={...}> y, al hacer clic, es analizada por el navegador como una URL javascript_disabled: que ejecuta un script controlado por el atacante en la sesión de la víctima. Las aplicaciones que renderizan URL proporcionadas por el usuario (por ejemplo, enlaces de perfil, objetivos de redirección o referencias externas) a través de <.link href={...}> se ven afectadas. Este problema afecta a phoenix_live_view: desde la versión 1.2.2 anterior a la 1.2.7.

References

Sources

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