Cross-site Scripting (XSS)Weakness · CWE-79

CVE-2025-51859

MEDIUM · 6.5 CVSS v3.1 Published 2025-07-22
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
72/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Stored Cross-Site Scripting (XSS) vulnerability in Chaindesk thru 2025-05-26 in its agent chat component. An attacker can achieve arbitrary client-side script execution by crafting an AI agent whose system prompt instructs the underlying Large Language Model (LLM) to embed malicious script payloads (e.g., SVG-based XSS) into its chat responses. When a user interacts with such a malicious agent or accesses a direct link to a conversation containing an XSS payload, the script executes in the user's browser. Successful exploitation can lead to the theft of sensitive information, such as JWT session tokens, potentially resulting in account hijacking.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · moderate confidence

Stored XSS vulnerability in Chaindesk's agent chat component where attackers craft malicious AI agents with system prompts instructing the LLM to embed script payloads (e.g., SVG-based XSS) into chat responses. When users interact with or view conversations containing the malicious agent's responses, the payload executes in their browser, enabling theft of JWT session tokens and account hijacking.

MitigationImplement output encoding/sanitization on LLM responses before rendering in the chat UI, deploy Content Security Policy (CSP) headers to restrict script execution, and consider adding runtime detection for XSS patterns in LLM-generated content.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Confirm Chaindesk deployment
    Search for Chaindesk installation directories, running processes, or container images. Check for package.json with chaindesk dependency or npm list chaindesk. Look for typical deployment paths like /opt/chaindesk, /app, or check docker ps for chaindesk containers.
    Affected if Chaindesk is deployed in the environment and the agent chat component is accessible to users.
  2. Identify chat component accessibility
    Verify the web UI or API endpoint for agent chat is exposed. Check if users can create, modify, or import custom AI agents with system prompts. Look for agent creation interfaces or import functionality.
    Affected if Users or attackers can create custom agents with arbitrary system prompts through the platform.
  3. Inspect LLM response sanitization
    Examine the code that handles LLM responses before rendering in the chat UI. Search for output encoding functions, DOMPurify usage, or XSS sanitization libraries. Check if responses are passed directly to innerHTML, document.write, or similar dangerous DOM APIs without sanitization.
    Affected if LLM-generated content is rendered without proper output encoding or sanitization, or sanitization is absent/disabled.
  4. Verify Content Security Policy headers
    Inspect HTTP responses from the chat interface using browser devtools or curl -I. Check for Content-Security-Policy header and its directives, particularly script-src, object-src, and default-src. Look for CSP in server configuration or middleware.
    Affected if CSP headers are missing, weak, or do not restrict script execution (e.g., using unsafe-inline or unsafe-eval).
  5. Review agent system prompt restrictions
    Check if the platform enforces restrictions on system prompts for custom agents. Look for prompt validation, prompt injection detection, or limitations on what instructions can be set. Examine admin or workspace settings for agent creation policies.
    Affected if Users can create agents with arbitrary system prompts without validation or restrictions, allowing prompt injection attacks.

A user is affected if Chaindesk is deployed with the agent chat component accessible, and LLM responses are rendered without output sanitization or CSP protections, allowing stored XSS payloads embedded via malicious agent system prompts to execute.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Implement output encoding/sanitization on LLM responses before rendering in the chat UI, deploy Content Security Policy (CSP) headers to restrict script execution, and consider adding runtime detection for XSS patterns in LLM-generated content.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
16.0 hours of engineering $2,800
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,480.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-51859 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-51859 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data