Servers and applications
CVE-2026-21866
Dify - Stored XSS in chat
- Severity
- Medium 5.7
- Published
- 3 Mar 2026
- Last changed
- 3 Mar 2026
- Added to UpHeron
- 3 Nov 2026
- Exploit chance
- 0.3% in the next 30 daysHigher than 16% of CVEs. EPSS by FIRST, 19 Nov 2026
- Weakness
- Cross-site scripting (CWE-79)
- Attack
- Over the network · Needs a user account · Needs someone to click or open something
- Attacker can
- Read data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N- Also known as
- GHSA-qpv6-75c2-75h4
- Sources
- Project advisories (GitHub)
Description
We have identified a vulnerability that can result in stored XSS in chat conversations. This can result in an attacker creating a malicious chat, which, when shared, will compromise a victim's session.
Dify is vulnerable to a stored XSS issue when rendering Mermaid diagrams within chats. This occurs because Dify’s default Mermaid configuration uses securityLevel: loose, which allows potentially unsafe content to execute.
web/app/components/base/mermaid/index.tsx
In Mermaid Gantt diagrams, you can attach click events to tasks, directing them either to a JavaScript callback or to an external link. This feature is available only when securityLevel is set to ‘loose’ and it is disabled when securityLevel is set to ‘strict’.
This configuration allows users to embed JavaScript-based payloads into chatbot conversations by using the javascript protocol.
This can result in an attacker creating a malicious chat, which, when shared, will compromise a victim's session.
Affected software
| Software | Affected versions |
|---|---|
DifyServers and applications · github:langgenius/dify |
|
About Dify
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
- GitHub stars
- 161,177GitHub, 15 Nov 2026
- Forks
- 25,501GitHub, 15 Nov 2026
- Latest release
- 1.19.0GitHub, 15 Nov 2026
- Released
- 4 Nov 2026GitHub
- First published on GitHub
- 12 Apr 2023GitHub
Vulnerabilities in Dify
- In our list
- 42
- Published in the last 12 months
- 21
- Critical, last 12 months
- 3
- High, last 12 months
- 7
- Known exploited
- 0
- GHSA-6j8g-rp8v-55vrPer-IP Rate Limit Bypass via Spoofable X-Forwarded-For and CF-Connecting-IP HeadersMedium 6.5 14 Nov 2026
- CVE-2026-58141Dify < 1.15.0 SSRF Protection Bypass via Remote-Files EndpointsHigh 7.2 6 Nov 2026
- CVE-2026-123135langgenius dify Sandbox Run __init__.py hard-coded credentialsMedium 5.3 5 Nov 2026
- CVE-2026-105761IDOR in AppMCPServer PUT Endpoint Allows Modification of Other Apps' MCP ServersHigh 7.1 19 Aug 2026
- GHSA-9c9q-5rj5-mjj2Cross-Tenant File Preview via Unscoped Console `file_id`High 7.7 15 Jul 2026
- GHSA-fj5w-7rc8-3f3fCross-Tenant External API Usage EnumerationMedium 4.3 15 Jul 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-21866
- GitHub Advisory Database https://github.com/advisories/GHSA-qpv6-75c2-75h4
- github.com https://github.com/langgenius/dify/security/advisories/GHSA-qpv6-75c2-75h4