Skip to main content

Dify CVE-2025-58747

LOW
Cross-site Scripting (XSS) (CWE-79)
2025-10-17 security-advisories@github.com
2.0
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker deploys malicious remote MCP server
  2. Delivery
    Victim connects to server in Dify
  3. Exploit
    Server returns javascript: authorization_url
  4. Execution
    window.open executes the URI
  5. Impact
    Arbitrary JavaScript runs in Dify context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the victim to actively connect, from within Dify, to a remote MCP server the attacker controls, and that server must return a javascript: URI in the OAuth authorization_url field; the unvalidated value is then handed to window.open. The flaw is in web/hooks/use-oauth.ts (openOAuthPopup) reached from the MCP detail connect flow in web/app/components/tools/mcp/detail/content.tsx. Limiting factors: active user interaction is mandatory (UI:A) - no drive-by path; the connect action is gated behind isCurrentWorkspaceManager in the source, so the victim must be a privileged workspace manager; and the attacker must get that victim to add/connect their malicious MCP server. Affects Dify through 1.9.1 per the description (note the version discrepancy with the advisory); updating to the fixed release is the remediation the vendor provides.

Impact

This is a low-severity, low-priority issue despite being a genuine XSS, and the signals are internally consistent. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:A) scores only 2.0 because the vulnerable-system impacts are all None (VC:N/VI:N/VA:N) and only subsequent-system confidentiality and integrity are rated Low (SC:L/SI:L); exploitation is gated by required active user interaction (UI:A) - the victim must initiate a connection to an attacker-controlled remote MCP server. The vuln.today Decision label is 'monitor', there is no CISA KEV listing and no EPSS score in the input, so there is no evidence of active exploitation - consistent with a low real-world priority. One signal to weigh: the input lists PR:N (no attacker privileges on Dify), but the fixed source (content.tsx guarded by isCurrentWorkspaceManager) indicates the victim who connects the MCP server must be a privileged workspace manager; this limits who can be targeted even though it does not change the attacker's own privilege requirement. A public PoC reference exists but is not verified as working exploit code. Net: a real but narrowly-conditioned client-side XSS, correctly rated low - not a high-CVSS-but-low-risk mismatch, simply a low-impact bug.

Exploit ScenarioDerived

An attacker stands up a malicious remote MCP server that returns a JavaScript URI (e.g. javascript:alert(1)) in the OAuth authorization_url field. When a Dify user is induced to connect to that server, Dify passes the URL straight to window.open via openOAuthPopup, executing the attacker's JavaScript in the Dify application context. A public PoC reference (a gist MCP server) is linked in the GHSA advisory but is not verified as working exploit code; exploitation requires network reach (AV:N) and active victim interaction (UI:A), with low attack complexity (AC:L).

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 6.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 10, 2026

Cross-site scripting in Dify's MCP OAuth flow (versions through 1.9.1) lets an attacker-controlled remote MCP server return a JavaScript URI in the authorization_url field, which Dify passes to window.open without validation and which then executes in the context of the Dify application. The victim must be a workspace manager who actively adds and connects to the malicious remote MCP server, so exploitation requires both attacker-supplied infrastructure and deliberate user action; this is a low-severity, low-priority issue despite being a genuine XSS, and the signals are internally consistent. A public PoC reference exists (a Gist containing a malicious MCP server script used in the advisory demonstration); it is not verified as working exploit code, and there is no CISA KEV listing indicating active exploitation.

RemediationAI

Apply the upstream fix or a release that contains it: commit bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3 (https://github.com/langgenius/dify/commit/bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3) introduces web/utils/urlValidation.ts and rejects any authorization_url that is not http: or https: before window.open is called; the vendor advisory (https://github.com/langgenius/dify/security/advisories/GHSA-9jch-j9qf-vqfw) lists 1.8.0 as the fixed release, which conflicts with the CVE description's 'through 1.9.1' range, so confirm the deployed build actually includes the validation module. If upgrading is not immediately possible, the practical compensating control is to have workspace managers avoid adding or connecting to remote MCP servers they do not fully trust, since the malicious value originates entirely from that server's OAuth response and the connect action is gated behind isCurrentWorkspaceManager; the trade-off is loss of remote MCP functionality for those users. Note that updating to the fixed release is the remediation the vendor provides, and the fix has a side effect worth planning for: any legitimate MCP server that returns a non-HTTP(S) authorization_url will now be rejected with an error rather than opening a popup.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Dify's remote MCP (Model Context Protocol) integration implements an OAuth handshake in the browser: the backend returns an authorization_url supplied by the remote MCP server, and the frontend opens it in a popup. The vulnerable path is web/hooks/use-oauth.ts (openOAuthPopup), reached from the MCP detail connect flow in web/app/components/tools/mcp/detail/content.tsx, where res.authorization_url is passed straight to window.open. Because the scheme is never checked, a value such as javascript:alert(1) is treated as a navigable URI and executes script in the Dify origin - a CWE-79 cross-site scripting issue rooted in missing scheme allow-listing on an externally supplied redirect target, consistent with the CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N assessment (scope change, low confidentiality/integrity, no availability impact, user interaction required). The upstream fix commit bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3 adds a new web/utils/urlValidation.ts module whose validateRedirectUrl() parses the URL with the WHATWG URL API and throws unless the protocol is http: or https:, and calls it at the top of openOAuthPopup. The CPE string cpe:2.3:a:langgenius:dify:*:*:*:*:*:node.js:*:* reflects that the affected component ships with the Node.js-based Dify web application; the trigger for the script execution is the popup navigation described above, not any server-side parsing flaw.

Know when Dify gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 2.0 LOW
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:P
vuln.today AI 6.1 MEDIUM

Reflected/DOM-style XSS triggered over the network with low complexity but requiring victim interaction (UI:R); JavaScript runs in the Dify app context distinct from the MCP server (S:C) with limited confidentiality and integrity impact.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

DescriptionCVE.org

Dify is an LLM application development platform. In Dify versions through 1.9.1, the MCP OAuth component is vulnerable to cross-site scripting when a victim connects to an attacker-controlled remote MCP server. The vulnerability exists in the OAuth flow implementation where the authorization_url provided by a remote MCP server is directly passed to window.open without validation or sanitization. An attacker can craft a malicious MCP server that returns a JavaScript URI (such as javascript:alert(1)) in the authorization_url field, which is then executed when the victim attempts to connect to the MCP server. This allows the attacker to execute arbitrary JavaScript in the context of the Dify application.

Threat Intelligence Overview

EPSS Score
6.0%
Top 7% exploitable
Prevalence
Medium
popular open-source LLM app platform, common but not universally deployed
Exploit
POC
Public exploit code exists
Data Quality
3 sources
Confidence: Low

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 6.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Low

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: +6
CVSS: +10
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

cpe:2.3:a:langgenius:dify:*:*:*:*:*:node.js:*:*

More in Dify

View all
CVE-2025-63387 MEDIUM POC
4.3 Dec 18

Dify 1.9.1 permits unauthenticated remote GET requests to the /console/api/system-features console endpoint, letting ano

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

CVE-2026-41948 CRITICAL POC
9.3 May 18

Path traversal in Dify versions 0 through 1.14.1 allows authenticated tenants to escape their authorized tenant path and

CVE-2026-41947 CRITICAL POC
9.3 May 18

Cross-tenant authorization bypass in LangGenius Dify versions through 1.14.1 lets any logged-in editor reroute another t

CVE-2025-1796 HIGH POC
8.8 Mar 20

A vulnerability in langgenius/dify v0.10.1 allows an attacker to take over any account, including administrator accounts

CVE-2026-61461 HIGH POC
8.7 Jul 10

SQL injection in Dify's MyScale vector store backend (versions before 1.16.0-rc1) lets authenticated attackers execute a

CVE-2025-67732 HIGH POC
8.4 Jan 05

Plaintext exposure of third-party service API keys in Dify prior to version 1.11.0 allows any authenticated non-administ

CVE-2026-41949 HIGH POC
8.2 May 18

Cross-tenant document disclosure in Dify 1.14.1 and prior allows any authenticated user to read up to 3,000 characters o

CVE-2024-12039 HIGH POC
8.1 Mar 20

langgenius/dify version v0.10.1 contains a vulnerability where there are no limits applied to the number of code guess a

CVE-2024-12776 HIGH POC
8.1 Mar 20

In langgenius/dify v0.10.1, the `/forgot-password/resets` endpoint does not verify the password reset code, allowing an

CVE-2025-43862 HIGH POC
7.6 Apr 25

Dify is an open-source LLM app development platform. Rated high severity (CVSS 7.6), this vulnerability is remotely expl

CVE-2024-11824 HIGH POC
7.6 Mar 20

A stored cross-site scripting (XSS) vulnerability exists in langgenius/dify version latest, specifically in the chat log

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy