Skip to main content
Vulnerability Database/CVE-2025-57665

CVE-2025-57665: Element-plus el-link Component XSS Vulnerability

CVE-2025-57665 is a cross-site scripting flaw in Element-plus el-link component that allows attackers to inject malicious URLs through insufficient href validation. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-57665 Overview

CVE-2025-57665 affects the Element Plus el-link component through version 2.10.6. The component passes user-controlled href attribute values directly to underlying HTML anchor elements without protocol validation or URL sanitization. Attackers can inject dangerous protocols such as javascript:, data:, or file: to trigger cross-site scripting (XSS). The flaw also enables open redirect and phishing attacks when applications render untrusted URLs through the component. The weakness is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Applications rendering untrusted URLs via el-link can execute attacker-controlled JavaScript in victim browsers or redirect users to malicious sites.

Affected Products

  • Element Plus (element-plus npm package) through version 2.10.6
  • Vue.js applications consuming the el-link component with user-controlled href values
  • Front-end projects relying on Element Plus as their UI component library

Discovery Timeline

  • 2025-09-09 - CVE-2025-57665 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database
  • Vendor remediation tracked in Element Plus PR #21711

Technical Details for CVE-2025-57665

Vulnerability Analysis

The el-link component is a wrapper around the native HTML <a> element. It accepts an href prop from consuming applications and binds the value directly to the rendered anchor's href attribute. The component performs no protocol allow-listing, no URL parsing, and no rendering of security attributes such as rel="noopener noreferrer" by default.

When developers pass user-controlled strings into href, attackers can supply javascript: URIs that execute arbitrary script in the victim's browser context when clicked. The data: scheme enables inline HTML and script payload delivery. The file: scheme can be abused in Electron and other embedded WebView contexts.

The component's abstraction obscures the risk. Developers may assume the UI library enforces input sanitization because it ships as a reusable security-conscious primitive. The absence of safeguards creates a security abstraction gap documented by the researcher.

Root Cause

The root cause is missing input validation in packages/components/link/src/link.vue. The component binds the href prop with Vue's v-bind directive without filtering unsafe schemes or validating that the value is an absolute HTTPS URL, a relative path, or an anchor fragment.

Attack Vector

Exploitation requires an application to render an el-link with an attacker-influenced href value. Common sources include profile fields, comment bodies, search parameters, and CMS content. A victim who clicks the crafted link triggers script execution in the application origin or is redirected to an attacker-controlled domain. Successful XSS enables session theft, token exfiltration, and account takeover against the hosting application.

No verified proof-of-concept code is published. Refer to the Element Plus Link Component source and the upstream fix PR #21711 for implementation specifics.

Detection Methods for CVE-2025-57665

Indicators of Compromise

  • Rendered <a> elements whose href attribute begins with javascript:, data:text/html, or file: within pages that use Element Plus
  • Browser console errors or Content Security Policy (CSP) violation reports referencing inline script execution originating from anchor clicks
  • Outbound navigations from application pages to unexpected external hosts not present in the organization's link allow-list

Detection Strategies

  • Perform static analysis of Vue single-file components for <el-link> tags whose :href binding resolves from request input, route parameters, or persisted user data
  • Run dependency scanning (npm audit, osv-scanner, Snyk) against lockfiles to flag element-plus versions at or below 2.10.6
  • Add dynamic application security testing (DAST) payloads that submit javascript:alert(1) into fields later rendered through link components

Monitoring Recommendations

  • Enable CSP reporting with script-src 'self' and monitor report-uri endpoints for violations tied to anchor-triggered inline execution
  • Log client-side navigation events and alert on href values containing non-allow-listed schemes
  • Review web application firewall (WAF) telemetry for request bodies containing javascript:, data:, or vbscript: substrings targeting known profile and content endpoints

How to Mitigate CVE-2025-57665

Immediate Actions Required

  • Upgrade element-plus to the fixed release that incorporates PR #21711 once published to npm
  • Audit application code for el-link usage bound to untrusted input and apply server-side or client-side URL validation before rendering
  • Deploy a strict CSP that disallows inline scripts and restricts navigation targets with navigate-to or form-action directives where supported

Patch Information

The maintainers addressed the issue in Element Plus PR #21711. Consumers should update to the first release containing this merge via the Element Plus NPM Package. Verify the fix is present by inspecting the installed link.vue source for protocol validation logic.

Workarounds

  • Wrap el-link in a helper component that validates href against an allow-list of http:, https:, mailto:, and relative paths before rendering
  • Sanitize stored URLs on write using a library such as DOMPurify's URL schema validator or a custom parser based on the WHATWG URL API
  • Add rel="noopener noreferrer" and target="_blank" only after confirming the URL scheme is safe, and reject links that fail validation
bash
# Upgrade Element Plus and verify installed version
npm install element-plus@latest
npm ls element-plus

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.