Scheme validation bypass in Phoenix.LiveView.Utils leads to XSS via <.link>
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-58228
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 18:14 UTC · Revision 1
Source evidence
Scheme validation bypass in Phoenix.LiveView.Utils leads to XSS via <.link>
core-osv · Original sourcePublished 13 Jul 2026, 18:04 UTC
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.
osv:CVE-2026-58228
Complete source record
{
"id": "557f344b194d477aeea26853cb2b92402dfcb5731eb2b07436bafec11f7089cb",
"url": "https://osv.dev/vulnerability/CVE-2026-58228",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Scheme validation bypass in Phoenix.LiveView.Utils leads to XSS via <.link>",
"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.",
"evidence": "osv:CVE-2026-58228",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-58228",
"aliases": [
"CVE-2026-58228",
"EEF-CVE-2026-58228",
"GHSA-5cgh-g58j-m9cq"
],
"metrics": [
{
"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"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/phoenixframework/phoenix_live_view",
"type": "GIT",
"events": [
{
"introduced": "4b63216ae68886db99cf7772af23372d76c40e7e"
},
{
"fixed": "86165533e311469a1b62093fd182d9d874de8106"
},
{
"introduced": "5789176010e4456a28c7d84b9f19ff9d7b4a93ee"
},
{
"fixed": "2570f650c2cc6f2ff925f7f498516c3053ebd9b0"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "4b63216ae68886db99cf7772af23372d76c40e7e"
},
{
"fixed": "86165533e311469a1b62093fd182d9d874de8106"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"introduced": "1.2.2"
},
{
"fixed": "1.2.7"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"fixed": "86165533e311469a1b62093fd182d9d874de8106"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v1.2.6",
"v1.2.5",
"v1.2.4",
"v1.2.3",
"v1.2.2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-58228.json"
}
}
],
"modified": "2026-10-28T02:30:31.296582192Z",
"provider": "osv",
"references": [
"https://cna.erlef.org/cves/CVE-2026-58228.html",
"https://github.com",
"https://osv.dev/vulnerability/EEF-CVE-2026-58228",
"https://repo.hex.pm",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/58xxx/CVE-2026-58228.json",
"https://github.com/phoenixframework/phoenix_live_view/security/advisories/GHSA-5cgh-g58j-m9cq",
"https://nvd.nist.gov/vuln/detail/CVE-2026-58228",
"https://github.com/phoenixframework/phoenix_live_view/commit/86165533e311469a1b62093fd182d9d874de8106",
"https://github.com/phoenixframework/phoenix_live_view"
],
"provider_metadata": {
"cwe_ids": [
"CWE-79"
],
"cna_assigner": "EEF",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/58xxx/CVE-2026-58228.json"
}
},
"related_cves": [
{
"value": "CVE-2026-58228",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 498327,
"published_at": "2026-07-13T18:04:30.636+00:00"
}