
Technical write-up on an authorization bypass in Dify’s MCP server management API
Author: Juhyuk Choi (@JHC56)
CVE Record | GitHub Advisory | KNVD | NVD
An authenticated workspace member could change or disable another app's MCP server in Dify versions before 1.16.0.
CWE-639 (IDOR) · CVSS 3.1: 7.1 (High)
In AppMCPServerController.put(), the URL identified the authorized app. The request body independently selected the server to update.
server = db.session.get(AppMCPServer, payload.id)
The lookup used the server ID alone. The patch also checks the tenant and app IDs from the authorized app. Patched lookup
I tested Dify 1.14.2 in Docker with two apps in one workspace. Both had MCP servers. The test required an authenticated session for the attacker's app and the victim's server ID.
PUT /console/api/apps/<ATTACKER_APP_ID>/server HTTP/1.1
Host: localhost
Authorization: Bearer <ATTACKER_TOKEN>
Content-Type: application/json
{
"id": "<VICTIM_SERVER_ID>",
"description": "HACKED",
"status": "inactive",
"parameters": {"injected": "malicious"}
}
Dify returned 200 OK. A separate read of the victim's server confirmed the changes:
description: Original Config → HACKEDstatus: active → inactiveparameters: {"version":"1.0"} → {"injected":"malicious"}The test confirmed unauthorized configuration changes and server deactivation within one workspace.
Both test apps shared a tenant ID. Checking the tenant alone would therefore allow either server. The management API had to enforce that boundary before any model or tool ran.
The same patch shows how two other controllers pass the parent resource into a service call:
create_app_workflow_ref(app_model, workflow_id). The service receives the workflow ID in the context of the authorized app. workflow.pyDocumentService.delete_documents. datasets_document.pyUpgrade to Dify 1.16.0 or later. Patch and tests
Dify published the advisory on August 19, 2026, and credited JHC56 as the reporter.