Dify Stored Cross-Site Scripting Vulnerability via SVG File Upload

Vulnerability

A stored cross-site scripting vulnerability has been identified in Dify, an open-source platform for developing applications with large language models. This issue affects versions prior to 1.13.1. The vulnerability arises from the ability of any unauthenticated user to upload an SVG file containing malicious scripts through the `POST /api/files/upload` endpoint. Although this endpoint does not require authentication, the `POST /v1/files/upload` method, which is authenticated, is also susceptible to the same issue. Once uploaded, the SVG file can execute scripts when accessed, leading to session theft or performing actions on behalf of the user.

Impact

Exploitation of this vulnerability allows for stored cross-site scripting, where uploaded SVG files can execute scripts when accessed, potentially leading to session theft or actions being performed on behalf of the user.

Reproduction

To reproduce this vulnerability, upload an SVG file containing a script tag through the `POST /api/files/upload` endpoint without authentication. Alternatively, use the `POST /v1/files/upload` method with an application API key, as this endpoint also allows for the upload of malicious SVG files.

Remediation

Users can upgrade to Dify version 1.13.1 or later to address this vulnerability.

Added: May 4, 2026, 6:21 PM
Updated: May 4, 2026, 6:21 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
1.7
exploitability
5.8
remediation
7.7
relevance
7.4
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.