{"schema_version":"1.9.2","id":"EEF-CVE-2026-58228","published":"2026-07-13T18:04:30.636Z","modified":"2026-11-25T17:23:14.984299087Z","aliases":["CVE-2026-58228","GHSA-5cgh-g58j-m9cq"],"summary":"Scheme validation bypass in Phoenix.LiveView.Utils leads to XSS via <.link>","details":"## Summary\n\nCross-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.\n\nThe `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.\n\nStandard 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.\n\nApplications that render user-supplied URLs (for example profile links, redirect targets, or external references) via `<.link href={...}>` are affected.\n\nThis issue affects phoenix_live_view: from 1.2.2 before 1.2.7.\n\n## Workarounds\n\nStrip 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.","affected":[{"package":{"name":"phoenix_live_view","ecosystem":"Hex","purl":"pkg:hex/phoenix_live_view"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.2.2"},{"fixed":"1.2.7"}]}],"versions":["1.2.2","1.2.3","1.2.4","1.2.5","1.2.6"],"ecosystem_specific":{"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.Phoenix.LiveView.Utils'"],"program_files":["lib/phoenix_live_view/utils.ex"],"program_routines":["'Elixir.Phoenix.LiveView.Utils':valid_destination!/2","'Elixir.Phoenix.LiveView.Utils':valid_live_navigation_destination!/2"]},"database_specific":{"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.Phoenix.LiveView.Utils'"],"program_files":["lib/phoenix_live_view/utils.ex"],"program_routines":["'Elixir.Phoenix.LiveView.Utils':valid_destination!/2","'Elixir.Phoenix.LiveView.Utils':valid_live_navigation_destination!/2"],"source":"https://cna.erlef.org/osv/EEF-CVE-2026-58228.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/phoenixframework/phoenix_live_view","events":[{"introduced":"4b63216ae68886db99cf7772af23372d76c40e7e"},{"fixed":"86165533e311469a1b62093fd182d9d874de8106"}]}],"versions":["v1.2.6","v1.2.5","v1.2.4","v1.2.3","v1.2.2"],"database_specific":{"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.Phoenix.LiveView.Utils'"],"program_files":["lib/phoenix_live_view/utils.ex"],"program_routines":["'Elixir.Phoenix.LiveView.Utils':valid_destination!/2","'Elixir.Phoenix.LiveView.Utils':valid_live_navigation_destination!/2"],"source":"https://cna.erlef.org/osv/EEF-CVE-2026-58228.json"}}],"references":[{"type":"ADVISORY","url":"https://github.com/phoenixframework/phoenix_live_view/security/advisories/GHSA-5cgh-g58j-m9cq"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-58228.html"},{"type":"WEB","url":"https://github.com/phoenixframework/phoenix_live_view/commit/4b63216ae68886db99cf7772af23372d76c40e7e"},{"type":"FIX","url":"https://github.com/phoenixframework/phoenix_live_view/commit/86165533e311469a1b62093fd182d9d874de8106"},{"type":"PACKAGE","url":"https://hex.pm/packages/phoenix_live_view"}],"database_specific":{"$schema":"https://cna.erlef.org/schemas/osv/record-0.1.0.json","capec_ids":["CAPEC-63"],"cpe_ids":["cpe:2.3:a:phoenixframework:phoenix_live_view:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-79"]},"severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:H/SI:H/SA:N","source":"CNA"}],"credits":[{"name":"Barna Kovacs","type":"FINDER"},{"name":"Jonatan Männchen / EEF","type":"ANALYST"},{"name":"José Valim","type":"ANALYST"},{"name":"Steffen Deusch","type":"REMEDIATION_DEVELOPER"}]}