Dify vulnerability exploitation skill
Dify is an open-source LLM application development platform, providing visual AI workflow orchestration, RAG, Agent and other features.
Its web console is built on Next.js (React Server Components), with a Python Flask backend.
This skill covers two vulnerabilities: an SSRF targeting the backend API, and an RCE targeting the Next.js frontend.
Identification features: page title contains "Dify", default ports 80/443/3000, Shodan http.title:"Dify"
Vulnerability overview
| CVE |
Type |
Authentication |
Impact |
CVSS |
| CVE-2025-56520 |
SSRF |
Not required |
Read internal network resources, probe internal network services |
9.3 |
| CVE-2025-55182 |
Deserialization RCE |
Not required |
Remote code execution |
10.0 |
Attack decision tree
已识别目标为 Dify?
├── 想要获取内网访问/云凭据?
│ └── 使用 CVE-2025-56520 SSRF → 参考 references/cve-2025-56520-ssrf.md
├── Dify 控制台使用 Next.js 且版本受影响?
│ └── 使用 CVE-2025-55182 RCE → 参考 references/cve-2025-55182-rce.md
├── 不确定?
│ ├── 先尝试 SSRF(风险较低,不易触发告警)
│ └── 再尝试 RCE(危害更大)
└── 两个漏洞可组合:先 SSRF 探测内网,再 RCE 获取 Shell
Combined exploitation flow
- SSRF probing: CVE-2025-56520 to learn the internal network topology and cloud credentials
- RCE breakthrough: CVE-2025-55182 to obtain a server shell
- Post-exploitation: use the internal network services discovered via SSRF for lateral movement
Key endpoints quick reference
| Endpoint |
CVE |
Purpose |
GET /console/api/remote-files/<url> |
56520 |
SSRF, URL-encode the target address |
POST / + Next-Action: x header |
55182 |
RCE, multipart deserialization |
Detection and defense
- Detection:
/console/api/remote-files/ contains an internal IP; POST contains Next-Action + __proto__; abnormal x-action-redirect header
- Remediation: upgrade Dify and the React/Next.js dependencies; URL allowlist; WAF to block
__proto__/execSync; restrict outbound connections
Nuclei automated scanning
| Template file |
CVE |
Purpose |
scripts/CVE-2025-56520.yaml |
56520 |
SSRF detection |
scripts/CVE-2025-55182.yaml |
55182 |
RCE detection |
nuclei -t scripts/CVE-2025-56520.yaml -u http://target
nuclei -t scripts/CVE-2025-55182.yaml -u http://target
nuclei -t scripts/ -l targets.txt # 批量扫描
Detailed reference