{"id":"EEF-CVE-2026-58228","summary":"Scheme validation bypass in Phoenix.LiveView.Utils leads to XSS via \u003c.link\u003e","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 \u003c.link href={...}\u003e 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 \u003c.link href={...}\u003e 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 \u003c.link href={...}\u003e, or reject such inputs outright. This aligns application-level validation with the WHATWG URL parser used by browsers and prevents the scheme-detection bypass.","aliases":["CVE-2026-58228","GHSA-5cgh-g58j-m9cq"],"modified":"2026-09-08T03:45:08.391237075Z","published":"2026-07-13T18:04:30.636Z","database_specific":{"cwe_ids":["CWE-79"],"capec_ids":["CAPEC-63"],"cpe_ids":["cpe:2.3:a:phoenixframework:phoenix_live_view:*:*:*:*:*:*:*:*"]},"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":"FIX","url":"https://github.com/phoenixframework/phoenix_live_view/commit/86165533e311469a1b62093fd182d9d874de8106"},{"type":"PACKAGE","url":"https://hex.pm/packages/phoenix_live_view"}],"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"],"database_specific":{"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":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-58228.json"}}],"schema_version":"1.9.0","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"}],"credits":[{"name":"Barna Kovacs","type":"FINDER"},{"name":"Steffen Deusch","type":"REMEDIATION_DEVELOPER"},{"name":"José Valim","type":"ANALYST"},{"name":"Jonatan Männchen / EEF","type":"ANALYST"}]}