CVE-2026-21866: langgenius dify · Cross-site Scripting
Affects langgenius difySource CVE Database V5
Not known to be exploited · CVSS 5.1 Medium : upgrade to 1.11.2 when convenient.
Data as of 30 Oct 2026, 11:52 UTC
- EPSS
- 0.2% chance of exploitation in 30 days – higher than 16% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.11.2
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 3 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.
What to do
Upgrade dify and langgenius/dify to 1.11.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| langgeniusdify | Affected
| Fixed in
|
GitHublanggenius/difypkg:github/langgenius/difyOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
- Upgrade Dify installations to version 1.11.2 or later immediately to apply the fix that changes the Mermaid configuration to a secure securityLevel, preventing unsafe script execution.
- Review and restrict user permissions to limit who can submit or edit Mermaid diagrams within chats, reducing the attack surface.
- Implement input validation and sanitization on Mermaid diagram definitions before rendering, applying additional server-side checks if possible.
- Monitor chat logs and user submissions for suspicious Mermaid content or unexpected script tags.
- Educate users about the risks of interacting with untrusted chat content and encourage cautious behavior when clicking or viewing diagrams.
- Consider deploying Content Security Policy (CSP) headers that restrict script execution sources to mitigate impact if malicious scripts are injected.
- Regularly audit and update third-party libraries and dependencies, including Mermaid, to ensure security patches are applied promptly.
- Employ web application firewalls (WAFs) with rules tuned to detect and block XSS payloads in chat inputs. These measures collectively reduce the likelihood and impact of exploitation beyond simply upgrading the software.
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.