CVE-2026-21866 Dify - Stored XSS in chat

Medium 5.1 Published Updated

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.

Sources

Also known as GHSA-qpv6-75c2-75h4.

Is CVE-2026-21866 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free