CVE-2026-21866 Dify - Stored XSS in chat
Attackers can execute arbitrary scripts in user browsers via stored XSS in chat Mermaid diagrams, affecting Dify platform users.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2026-21866?
CVE-2026-21866 is a medium-severity cross-site scripting vulnerability in langgenius dify, published on 3 Mar 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
Dify is an open-source LLM app development platform. Prior to 1.11.2, 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. This vulnerability is fixed in 1.11.2.
Weakness: CWE-79
Which versions are affected by CVE-2026-21866?
It affects 1 product.
Products include Dify Dify.
How do I fix CVE-2026-21866?
No fix has been published for CVE-2026-21866 yet. Limit exposure of the affected software until one is available.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-21866 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-21866 exists.
Other vulnerabilities in langgenius dify
- CVE-2026-41947 Dify < 1.14.2 Authorization Bypass via Trace Configuration Endpoints
- CVE-2026-41948 Dify v1.14.1 Path Traversal via Plugin Daemon Internal API Access
- CVE-2025-0185 Pandas Query Injection in langgenius/dify
- CVE-2026-61461 Dify < 1.16.0-rc1 SQL Injection via MyScale Vector Store search_by_full_text
- CVE-2025-67732 Dify Vulnerable to Plaintext API Key Exposure via Model Provider Configuration Endpoint
Sources
Also known as GHSA-qpv6-75c2-75h4.