Junglewise Threat Intelligence

CVE-2026-42138: LangGenius Dify stored XSS via SVG file upload

CVE-2026-42138 · Severity: medium · CVSS 6.1 · Published 2026-05-04

Technologies: Langgenius Dify. Vendors: Langgenius.

Executive brief

Dify, an open-source platform for developing Large Language Model (LLM) applications, is vulnerable to a security flaw that allows attackers to upload malicious files. By uploading a specially crafted SVG image containing hidden scripts, an attacker can execute code in the browser of other users who view the file. This could lead to unauthorized actions being performed on behalf of users, session theft, or the exposure of sensitive account information.

Technical details

A stored Cross-Site Scripting (XSS) vulnerability exists in Dify's file upload functionality. The application fails to properly sanitize or neutralize malicious JavaScript embedded within SVG files uploaded via the 'POST /api/files/upload' (unauthenticated) and 'POST /v1/files/upload' (authenticated) endpoints. When a victim accesses the 'source_url' returned after the upload, the embedded script executes within the context of the victim's browser session. This can be leveraged to steal session tokens from Local Storage or perform unauthorized API actions. The issue is resolved in version 1.13.1.

Affected products

  • LangGenius Dify < 1.13.1

Timeline

  • 2026-04-20: advisory: GitHub Security Advisory GHSA-cg94-8v83-7hjj published
  • 2026-05-04: disclosed: CVE-2026-42138 published to NVD
  • 2026-03-17: patched: Version 1.13.1 released with fixes

References

Related threats