Summary
Argo CD contains a stored cross-site scripting vulnerability where specially crafted link.argocd.argoproj.io/* annotations are rendered into the UI as clickable URLs without validation.
An attacker with application write access can inject javascript: URLs that execute in the context of a higher-privileged user's authenticated Argo CD session when they view the Summary tab.
Affected context
The issue arises in Argo CD's web UI, specifically in the Application Summary tab where link.argocd.argoproj.io/* annotations are displayed as anchor elements.
It affects environments where:
- Users with application write access can control or update annotations on applications, and
- Higher-privileged users (such as admins or operators) routinely view those applications via the Argo CD web interface.
The vulnerability manifests when the UI renders pipe-separated annotation values directly into href attributes without enforcing URL schemes or sanitizing potentially dangerous protocols like javascript:.
Exploit preconditions
- Attack surface: Argo CD web UI, particularly the Application Summary tab displaying link.argocd.argoproj.io/* annotations.
- Required access: Ability to create or modify Argo CD applications with write access, including setting custom annotations on those applications.
- Trigger point: A higher-privileged user (or any target user) navigates to the affected application's Summary tab in the Argo CD UI, causing the malicious link to render and execute when clicked or auto-triggered by browser behavior.
- Why exploitation is possible: The front-end component (application-summary.tsx) uses annotation values as anchor hrefs without validating the URL scheme or sanitizing untrusted content, enabling javascript: URLs to be executed in the context of the victim's authenticated session.
Why this happens
The vulnerability stems from improper neutralization of user-controlled data before it is placed into the DOM, matching CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).
In this case, Argo CD's UI blindly trusts annotation values that are conceptually "metadata" but are effectively user input. These values are inserted into anchor href attributes without:
- Enforcing a safe allowlist of URL schemes (e.g., https:, http:, mailto:), or
- Applying robust sanitization or encoding for untrusted text.
This insecure pattern allows an attacker to inject javascript: or similarly dangerous URLs, which the browser interprets as executable script, leading to stored XSS that persists with the application configuration.
Potential impact
- Hijacking of higher-privileged Argo CD user sessions via malicious JavaScript execution.
- Unauthorized operations in the UI (e.g., modifying applications, changing synchronization policies) performed with the victim's privileges.
- Theft of sensitive data visible in the UI, including configuration details or environment metadata.
- Ability to pivot to further attacks against the Kubernetes cluster through compromised Argo CD accounts.
- Persistent malicious links embedded in application metadata that can target multiple users over time.
General mitigation guidance
Effective mitigation focuses on treating all annotation-derived UI content as untrusted and enforcing strict handling at the presentation layer:
- Apply a URL scheme allowlist when rendering links, ensuring only benign protocols (such as https:, http:, mailto:) are ever used in href attributes.
- Use well-vetted, framework-compatible libraries for HTML and URL sanitization, ensuring dangerous schemes and script execution vectors are stripped or neutralized.
- Render user-controlled values using context-aware encoding (e.g., HTML attribute encoding for href attributes) rather than interpolating raw strings into JSX/HTML.
- Separate "display label" from "actionable URL" where possible, storing and validating URLs at the server side, and exposing only safe, canonicalized values to the UI.
- Apply principle of least privilege to application write access so that fewer users can modify annotations that influence UI behavior.
How teams detect issues like this
Detection typically combines code-level analysis with behavioral checks in running systems:
- Use static application security testing (SAST) to identify components where user-controlled data flows into DOM sinks (e.g., href, src, dangerouslySetInnerHTML) without passing through validation or encoding functions.
- During code review, explicitly look for:
- Rendering of annotation values or other metadata into anchor tags, iframes, or script-related attributes.
- Lack of URL scheme validation before setting hrefs.
- Define linting or type-safe wrappers around link creation in the UI codebase, enforcing that all links are constructed via helper functions that validate and sanitize inputs.
- Employ dynamic application security testing (DAST) or automated browser-based tests that attempt to inject javascript: URLs into fields reflected as links in the UI.
- Monitor logs and telemetry for suspicious annotations or URLs embedded in application metadata, especially those containing javascript: or unusual URI schemes.

