CVE-2025-63386
📋 TL;DR
A CORS misconfiguration in Dify v1.9.1 allows arbitrary external domains to make authenticated requests to the /console/api/setup endpoint. This enables attackers to perform actions with the victim's credentials from malicious websites. All Dify v1.9.1 installations with the vulnerable endpoint exposed are affected.
💻 Affected Systems
- Dify
📦 What is this software?
Dify by Langgenius
⚠️ Risk & Real-World Impact
Worst Case
Complete account takeover and data exfiltration as attackers can perform any authenticated action on behalf of victims, potentially leading to full system compromise.
Likely Case
Session hijacking and unauthorized access to sensitive data through authenticated API calls from malicious domains.
If Mitigated
Limited impact with proper network segmentation and access controls, though the vulnerability still exists.
🎯 Exploit Status
Exploitation requires user interaction (visiting malicious site) but is technically simple once the malicious site is set up.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: https://github.com/langgenius/dify/discussions
Restart Required: No
Instructions:
No official patch available. Monitor Dify GitHub for updates and apply when released.
🔧 Temporary Workarounds
Restrict CORS Origins
allConfigure the application to only allow specific trusted origins instead of reflecting arbitrary origins.
Modify CORS configuration in Dify to set allowed_origins to specific domains
Disable Access-Control-Allow-Credentials
allRemove or set Access-Control-Allow-Credentials to false for the vulnerable endpoint.
Modify endpoint configuration to remove Access-Control-Allow-Credentials header
🧯 If You Can't Patch
- Implement strict network access controls to limit who can reach the /console/api/setup endpoint
- Use web application firewall (WAF) rules to block requests with suspicious Origin headers
🔍 How to Verify
Check if Vulnerable:
Send a request to /console/api/setup with Origin: https://evil.com and check if Access-Control-Allow-Origin reflects evil.com and Access-Control-Allow-Credentials is true.
Check Version:
Check Dify version in application interface or configuration files
Verify Fix Applied:
After applying workarounds, verify that Access-Control-Allow-Origin no longer reflects arbitrary origins and Access-Control-Allow-Credentials is false or absent.
📡 Detection & Monitoring
Log Indicators:
- Multiple requests to /console/api/setup with varying Origin headers
- Unusual cross-origin requests to authenticated endpoints
Network Indicators:
- CORS preflight requests from unexpected domains
- Cross-origin POST requests with credentials
SIEM Query:
source_ip=* AND uri_path="/console/api/setup" AND http_header.origin != "" AND http_header.origin != expected_domain