CVE-2026-58228
Deferred Deferred - Pending Action

XSS in Phoenix LiveView via URL Scheme Bypass

Vulnerability report for CVE-2026-58228, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-13

Last updated on: 2026-07-13

Assigner: EEF

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-13
Last Modified
2026-07-13
Generated
2026-08-03
AI Q&A
2026-07-14
EPSS Evaluated
2026-08-01
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
phoenixframework phoenix_live_view From 1.2.2 (inc) to 1.2.7 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-58228 is a cross-site scripting (XSS) vulnerability in the Phoenix LiveView framework, specifically in the Phoenix.LiveView.Utils module. The vulnerability arises from a flaw in the URL scheme validation logic used by the `valid_destination!/2` and `valid_live_navigation_destination!/2` functions.

These functions rely on an internal helper called `uri_scheme/1`, which only detects a URL scheme if the input's first byte is an ASCII letter. If the input starts with an ASCII control character or space, the helper returns `nil`, causing the URL to be treated as a safe relative path. However, browsers using the WHATWG URL parser strip leading control and space characters before parsing the URL. This allows malicious inputs like " javascript:alert(1)" to bypass validation and be executed as JavaScript when rendered via `<.link href={...}>`.

Applications that render user-supplied URLs (e.g., profile links, redirect targets, or external references) through `<.link>` components are affected by this vulnerability. The issue impacts Phoenix LiveView versions from 1.2.2 up to but not including 1.2.7.

Detection Guidance

Detecting this vulnerability requires checking if your application uses an affected version of Phoenix LiveView (1.2.2 to 1.2.6) and if it renders user-supplied URLs via the `<.link href={...}>` component. Since this is a code-level vulnerability, network-based detection is not straightforward, but you can follow these steps:

  • Check the Phoenix LiveView version in your project's dependency file (e.g., `mix.exs` for Elixir projects). Look for `phoenix_live_view` in the dependencies and verify if the version falls within the affected range (>= 1.2.2 and < 1.2.7).
  • Review your application's codebase for instances where user-supplied URLs are passed to `<.link href={...}>`. Search for patterns like `<.link href={@user_input}>` or similar dynamic URL assignments.
  • Test for the vulnerability by manually injecting a payload like ` javascript:alert(1)` (with a leading space or control character) into any user-controlled URL field rendered via `<.link>`. If the JavaScript executes when the link is clicked, the vulnerability is present.
  • Use static analysis tools or security scanners that support Elixir/Phoenix to detect unsafe URL handling in your codebase. Tools like Sobelow or custom scripts can help identify risky patterns.
Impact Analysis

This vulnerability can impact you in several ways if you are using an affected version of Phoenix LiveView (1.2.2 to 1.2.6) and your application renders user-supplied URLs via `<.link href={...}>`.

  • An attacker could execute arbitrary JavaScript in the context of a victim's browser session. This could lead to actions like session hijacking, where the attacker gains control of the victim's session.
  • The attacker could steal sensitive data, such as cookies, session tokens, or personal information, by exfiltrating it to a server under their control.
  • The vulnerability could enable stored or reflected XSS attacks, where malicious scripts are either stored on the server (e.g., in a user profile) or reflected back to the victim via a crafted link.
  • If your application handles sensitive operations (e.g., financial transactions, administrative actions), the attacker could manipulate these operations by executing unauthorized actions on behalf of the victim.

The impact is particularly severe if your application relies on Phoenix LiveView for rendering dynamic content and accepts user input for URLs without proper sanitization.

Compliance Impact

This vulnerability can have significant implications for compliance with common standards and regulations, depending on the nature of the data your application handles.

  • GDPR (General Data Protection Regulation): If your application processes personal data of EU citizens, this vulnerability could lead to unauthorized access or exfiltration of that data. Under GDPR, you are required to implement appropriate technical measures to protect personal data. A successful XSS attack could be considered a breach of confidentiality, potentially resulting in fines or legal action if the breach is not reported within the required timeframe (72 hours).
  • HIPAA (Health Insurance Portability and Accountability Act): If your application handles protected health information (PHI), this vulnerability could expose sensitive patient data. HIPAA requires covered entities to implement safeguards to protect PHI from unauthorized access. A successful exploit of this vulnerability could result in a reportable breach, leading to penalties and mandatory corrective actions.
  • PCI DSS (Payment Card Industry Data Security Standard): If your application processes payment card information, this vulnerability could compromise cardholder data. PCI DSS requires strict controls to protect such data, and a successful XSS attack could lead to non-compliance, resulting in fines or the revocation of your ability to process payments.

In general, most compliance frameworks require organizations to maintain the confidentiality, integrity, and availability of sensitive data. This vulnerability undermines these principles by allowing attackers to execute arbitrary scripts, potentially leading to data breaches or unauthorized actions. Failure to address such vulnerabilities could result in non-compliance and associated penalties.

Mitigation Strategies

To mitigate this vulnerability, follow these immediate steps:

  • Upgrade Phoenix LiveView to version 1.2.7 or later, which includes the fix for this issue. Update your dependency file (e.g., `mix.exs`) and run `mix deps.update phoenix_live_view` to apply the patch.
  • If upgrading is not immediately possible, apply a temporary mitigation by stripping or rejecting any user-supplied URLs that begin with ASCII control characters (0x00-0x1F) or spaces before passing them to `<.link href={...}>`. For example, in Elixir, you can use `String.trim_leading/1` or a custom validation function to sanitize inputs.
  • Review all instances where user-supplied URLs are rendered via `<.link>` and ensure they are properly validated or sanitized. Avoid passing raw user input directly to the `href` attribute.
  • Monitor your application for suspicious activity, such as unexpected JavaScript execution or unusual URL patterns, and log any attempts to exploit this vulnerability.
  • Consider implementing a Content Security Policy (CSP) to restrict inline script execution and mitigate the impact of potential XSS attacks.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-58228. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart