CVE-2025-51859
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 · uneditedStored 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 confidenceStored 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.
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 checksWork through these to decide whether this CVE applies to you.
-
Confirm Chaindesk deploymentSearch 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.
-
Identify chat component accessibilityVerify 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.
-
Inspect LLM response sanitizationExamine 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.
-
Verify Content Security Policy headersInspect 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).
-
Review agent system prompt restrictionsCheck 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.
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 dataImplement 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.
- Consultation2.0 h
- Implementation8.0 h
- Testing4.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-51859 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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