Test a Permission Fix Wherever the Same Rule Applies
A team can connect an external tool to its Dify workspace and use it in an app. Using that tool through the app takes one kind of permission. Removing its connection from the team's shared list takes another.
In our study, we registered a test connection as a regular workspace member. When we opened the admin interface, the name we'd given it was there in the shared list. Would fixing registration alone protect that list? Deleting an existing connection would change it too. That led us to look at a connection the workspace owner had already registered.
A tool connection shared by the workspace
We connected the external tool using the Model Context Protocol (MCP). When a server is registered in a workspace, Dify manages its address, the connection's authentication status, and the list of tools. The paper calls the resulting entry an MCP provider. Dify's documentation on MCP tools
Dify's documentation describes a Normal member as someone who can use published apps. The Owner manages the workspace. In the case we originally reported, the Normal member's interface offered no way to create a connection. Yet when that account requested a new connection, the server returned an identifier for it. Given those roles, we tested whether Dify required management permission to register a shared connection, read its management details, or change its settings. Dify's workspace role descriptions
Why we tested a connection the owner had created
Suppose a regular member renames a connection they have just created. A service that gives creators permission to edit their own items would produce the same result. Repeating the rename on the member's own connections would tell us little about how far the finding extends. We needed to keep the caller the same and change who had created the connection.
In our Dify 1.16.1 test environment, the owner of the same workspace created a separate connection. The regular member could read its management details and change its name and identifier. When we reopened the list after deletion, the owner's entry was gone.
The study covered six management operations. These were creating a connection, reading its details, authenticating the provider connection, editing its settings, refreshing its tools, and deleting it. Provider authentication concerns the connection between Dify and the external tool service. Both the member account and the owner account were already signed in to Dify.
Reading the details calls for a different interpretation. A read can disclose management information while leaving every stored value intact. The response included a partially masked server address, connection settings, authentication status, and the list of tools. Our test connection contained no custom headers or OAuth secrets. Our account of the disclosure therefore covers the management fields we actually saw.
Which check makes the decision in this deployment?
Dify 1.16.1 contains two authorization checks that serve different configurations. One checks whether the account has permission for the operation. The other checks for the Owner or Admin role in a configuration that uses the built-in roles. Which check runs on a request depends on the code applied to that operation and the deployment configuration. Dify source revision examined in the study
For a request to change a shared connection, these are the decisions each configuration needs to make.
Change a shared connection
├─ Built-in roles → May this role manage shared connections?
└─ Granular permissions → Does this account have management permission?
Finding a permission check in the source still leaves an open question about the configuration that's running. In the environment we studied, the conditional check did not make a management-permission decision, and the basic role check that should have made it was missing. The server established which workspace the member belonged to. It then proceeded without deciding whether that member could change the workspace's shared settings.
In a code review I'd ask which code would deny the member's request in the configuration being shipped. After locating a granular permission check, I'd still trace where a deployment using built-in roles checks the caller's role before allowing a change to shared settings.
We compared source across 30 releases to locate changes in the permission checks. We compared actual responses with stored values on version 1.16.1. The source comparison helps identify other releases that merit testing. The runtime evidence for the behavior described here comes from the configuration we ran on 1.16.1.
What was there on the next read?
We used a local MCP server. On the original build, the regular member performed the six operations on three separate test connections, one run per connection. All 18 requests returned HTTP 200. We counted the five requests against the owner-created connection separately. All five also returned HTTP 200. That told us what the server reported. To learn what the shared settings looked like afterwards, we read them back.
We assessed a rename by reading the same connection again. An edit response can echo the requested name even if it never persists, and the connection count stays constant either way. Table 1 of the paper therefore records the observed result of each operation alongside its HTTP status.
We read the connection details and the provider list after each operation. The updated name and identifier persisted. After the tool refresh, the stored list had gone from empty to one entry. After deletion, the connection had disappeared. At the end of each run, the workspace was back to the two connections it had started with.
A final count of two does not identify the entry that was removed. We checked both that the test connection was gone and that the list had returned to its original size.
The owner's edit still has to stick
We built a local revision that added the basic management-role check. All six operations attempted by the regular member returned HTTP 403. One was a creation request, which produced no new entry. We checked the other five against a connection the owner had created. It remained in place with its stored settings unchanged.
A build that blocked every user would have passed the denial tests. We therefore ran the same six operations as Owner. Section 3.2 of the paper reports that all six returned HTTP 200, the detail read returned management information, and the operations that changed state produced the expected changes in stored data.
| Management operation |
Regular member, original |
Regular member, local revision |
Owner response, local revision |
| Create |
New connection listed |
No new connection |
HTTP 200 |
| Read details |
Management information returned |
Read denied |
HTTP 200, management information returned |
| Authenticate provider |
Connection became authenticated |
Authentication status unchanged |
HTTP 200 |
| Edit settings |
Name and identifier changed |
Previous values retained |
HTTP 200 |
| Refresh tools |
Stored list grew from 0 tools to 1 |
Tool count unchanged |
HTTP 200 |
| Delete |
Connection removed from list |
Connection retained |
HTTP 200 |
An overall HTTP 200 rate would obscure the distinction in the table. A successful edit by a regular member violates the policy. The same outcome for the owner is exactly what the policy requires. The original and revised builds also received different numbers and mixes of requests. We judged the fix by whether each operation produced the expected outcome for each role we tested. Assessing Admin or a custom role would require tests with those roles.
Deciding the scope of the next fix
The impact we observed was confined to management of shared connections within one workspace. A member could read the details of a connection registered by someone else, change its settings, and remove it. Whether changing a connection also affects which tool a running app selects is a separate research question. It would require observing the app's choice during execution.
OWASP recommends identifying roles, resources, and permitted operations, and validating permissions on every request. Our resource was the team's shared connection. Following its management rule brought operations from creation through deletion into the same review. Personal settings within the same product could be governed by a different policy and would need their own assessment. OWASP Authorization Cheat Sheet
To assess a permission fix, review the operations governed by the same rule together. For a read, the evidence is what the server disclosed and to whom. For a change, it is whose request altered the stored value. A rename gives a concrete acceptance criterion. A regular member's request should leave the old name in place, and the owner's new name should appear on the next read.
Author and research credit
Jun-Yong Lee (TeamH4C R4C)
The experimental results come from Sections 2 and 3 of Analysis and Validation of Access Control Vulnerabilities in MCP Management APIs: A Dify MCP Case Study, by Jun-Yong Lee, Hyeongyu Lee, Nurihan Kim, and Jungmin Kang. Jun-Yong Lee, Hyeongyu Lee, and Nurihan Kim contributed equally as co-first authors. Jungmin Kang is the corresponding author.