CVE-2026-21866
Received Received - Intake
Stored XSS in Dify Mermaid Diagrams Allows Code Execution

Publication date: 2026-03-03

Last updated on: 2026-03-05

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-03
Last Modified
2026-03-05
Generated
2026-05-07
AI Q&A
2026-03-04
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
dify dify to 1.11.2 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability affects Dify, an open-source LLM app development platform, in versions prior to 1.11.2. It is a stored Cross-Site Scripting (XSS) issue that occurs when rendering Mermaid diagrams within chats. The root cause is that Dify's default Mermaid configuration uses a security level set to 'loose', which permits potentially unsafe content to execute scripts. This can allow malicious code to be stored and later executed in the context of the application.


How can this vulnerability impact me? :

The stored XSS vulnerability can allow attackers to inject malicious scripts into Mermaid diagrams that are rendered within chats. When other users view these diagrams, the malicious scripts can execute in their browsers, potentially leading to unauthorized actions such as stealing session tokens, performing actions on behalf of the user, or delivering malware. This can compromise user data and the integrity of the application.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

I don't know


What immediate steps should I take to mitigate this vulnerability?

To mitigate this vulnerability, upgrade Dify to version 1.11.2 or later, where the stored XSS issue related to Mermaid diagrams is fixed by changing the default Mermaid configuration from securityLevel: loose to a more secure setting.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart