Skip to content
Heist/ feed
Back to feed
Low

Dify MCP OAuth Flow Vulnerable to XSS

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-58747
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 13:01 UTC · Revision 1

Source evidence

Dify MCP OAuth Flow Vulnerable to XSS

core-osv · Original source

Published 17 Oct 2025, 15:48 UTC

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.

osv:CVE-2025-58747
Complete source record
{
  "id": "ed9f85d2654f3fc20165625a226cf9c2f011f59586a415fe1248754374ecec7b",
  "url": "https://osv.dev/vulnerability/CVE-2025-58747",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Dify MCP OAuth Flow Vulnerable to XSS",
    "summary": "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.",
    "evidence": "osv:CVE-2025-58747",
    "products": [],
    "severity": "low",
    "structured": {
      "id": "CVE-2025-58747",
      "aliases": [
        "CVE-2025-58747",
        "GHSA-9jch-j9qf-vqfw"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/langgenius/dify",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "ec871819e46de82f2f9ee33a71a61d96a58bdb37"
                },
                {
                  "fixed": "bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:langgenius:dify:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.9.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.6.0",
            "1.9.1",
            "1.9.0",
            "1.8.1",
            "1.8.0",
            "1.7.2",
            "1.7.1",
            "1.7.0",
            "1.5.1",
            "1.5.0",
            "1.4.3",
            "1.4.2",
            "1.4.1",
            "1.4.0",
            "1.3.0",
            "1.3.1",
            "1.2.0",
            "1.0.0",
            "1.1.3",
            "1.1.2",
            "1.1.1",
            "1.1.0",
            "1.0.1",
            "0.15.3",
            "0.10.2",
            "0.15.2",
            "0.15.1",
            "0.15.0",
            "0.14.2",
            "0.14.1",
            "0.8.3",
            "0.14.0",
            "0.13.2",
            "0.13.1",
            "0.13.0",
            "0.12.1",
            "0.12.0",
            "0.11.2",
            "0.11.1",
            "0.11.0",
            "0.10.1",
            "0.10.0",
            "0.9.2",
            "0.9.1",
            "0.9.0",
            "0.8.2",
            "0.8.1",
            "0.8.0",
            "0.7.3",
            "0.7.2",
            "0.7.1",
            "0.7.0",
            "0.6.16",
            "0.6.15",
            "0.6.14",
            "0.6.13",
            "0.6.12-fix1",
            "0.6.12",
            "0.6.11",
            "0.6.10",
            "0.6.9",
            "0.6.8",
            "0.6.7",
            "0.6.6",
            "0.6.5",
            "0.6.4",
            "0.6.3",
            "0.6.2",
            "0.6.1",
            "0.6.0-fix1",
            "0.6.0",
            "0.5.11-fix1",
            "0.5.11",
            "0.5.10",
            "0.5.9",
            "0.5.8",
            "0.5.7",
            "0.5.6",
            "0.5.5",
            "0.5.4",
            "0.5.3",
            "0.5.2",
            "0.5.1",
            "0.5.0",
            "0.4.9",
            "0.4.8",
            "0.4.7",
            "0.4.6",
            "0.4.5",
            "0.4.4",
            "0.4.3",
            "0.4.2",
            "0.4.1",
            "0.4.0",
            "0.3.34",
            "0.3.33",
            "0.3.32",
            "0.3.31-fix3",
            "0.3.31-fix2",
            "0.3.31-fix1",
            "0.3.31",
            "0.3.30",
            "0.3.29",
            "0.3.28",
            "0.3.27",
            "0.3.26",
            "0.3.25",
            "0.3.24",
            "0.3.23",
            "0.3.22",
            "0.3.21",
            "0.3.20",
            "0.3.19",
            "0.3.18",
            "0.3.17",
            "0.3.16",
            "0.3.15",
            "0.3.14",
            "0.3.13",
            "0.3.12",
            "0.3.11",
            "0.3.10",
            "0.3.9",
            "0.3.8",
            "0.3.7",
            "0.3.6",
            "0.3.5",
            "0.3.4",
            "0.3.3",
            "0.3.2",
            "0.3.1",
            "0.3.0",
            "0.2.2",
            "0.2.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-58747.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:28.881108573Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/58xxx/CVE-2025-58747.json",
        "https://github.com/langgenius/dify/security/advisories/GHSA-9jch-j9qf-vqfw",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-58747",
        "https://github.com/langgenius/dify/commit/bfda4ce7e6f39d43a4420e97e23a18edcfe3e3d3"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/58xxx/CVE-2025-58747.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-58747",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 495643,
  "published_at": "2025-10-17T15:48:04.98+00:00"
}