CVE-2025-58747: Dify MCP OAuth Flow Vulnerable to XSS

Published Oct 17, 2025
·
Updated

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 authorizationurl 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 authorizationurl 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.

Affected Software

2 affected components
Dify dify<=1.9.1
LangGenius Dify Node.js<1.9.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Dify MCP OAuth component to a version that resolves this vulnerability.

    Fixed in 1.9.1
  2. Configuration

    In the MCP OAuth flow, do not pass the remote MCP server's authorization_url directly to window.open; validate/sanitize the authorization_url to allow only safe, expected URL schemes/hosts before opening it.

    Dify MCP OAuth flow authorization_url validation/sanitization before window.open = enabled

Event History

Oct 17, 2025
CVE Published
via MITRE·03:48 PM
Data Sourced
via MITRE·03:48 PM
DescriptionWeakness
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 20, 57798
Event
via NVD·02:51 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-58747?

CVE-2025-58747 is a high-severity vulnerability due to its potential for cross-site scripting attacks.

2

How do I fix CVE-2025-58747?

To fix CVE-2025-58747, update Dify to version 1.9.2 or later where the vulnerability has been patched.

3

Who is affected by CVE-2025-58747?

CVE-2025-58747 affects users of Dify versions up to and including 1.9.1.

4

What type of vulnerability is CVE-2025-58747?

CVE-2025-58747 is classified as a cross-site scripting (XSS) vulnerability.

5

How can attackers exploit CVE-2025-58747?

Attackers can exploit CVE-2025-58747 by tricking victims into connecting to an attacker-controlled remote MCP server during the OAuth flow.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203