Summary
Dify contains a server-side request forgery (SSRF) flaw that can let an authenticated console user send requests to internal services or cloud metadata endpoints. The risk arises when Dify processes a user-supplied URL without independently validating its destination and the proxy configuration does not block requests to restricted destinations.
Affected context
The issue affects Dify deployments where URL-fetching features or workflow nodes can make outbound requests. Relevant paths include remote-file retrieval and upload, website crawling, document import from a URL, and the HTTP Request workflow node. The risk depends on how these features are exposed and on the network access available to the Dify runtime; AWS deployments may also be at risk of requests to instance metadata endpoints.
Exploit preconditions
- Attack surface: URL-fetching console endpoints, website crawl or document import features, and the HTTP Request workflow node
- Required access: An authenticated console account with access to a relevant feature or workflow
- Trigger point: Dify processes a user-provided URL or executes a workflow request
- Why exploitation is possible: The Squid configuration defines source ACLs without destination deny rules, while the
make_request()helper does not independently validate destination IP addresses
Why this happens
The application makes server-side HTTP requests based on user-controlled URLs without reliably restricting the destination. Source-only proxy ACLs do not prevent requests to internal or otherwise sensitive destinations, and the request helper lacks its own destination validation. This matches CWE-918: Server-Side Request Forgery (SSRF), in which an application can be induced to send requests to unintended systems.
Potential impact
- Requests could reach internal services such as the sandbox or internal APIs
- Attackers may be able to access data exposed by reachable internal components, subject to those components' controls
- On some AWS deployments, requests to instance metadata endpoints could expose IAM credentials
- HTTP Request workflows could send POST, PUT, or DELETE requests that may modify internal services
General mitigation guidance
Mitigation generally focuses on controlling outbound destinations at multiple layers rather than relying on a proxy's source ACLs alone.
Common defensive patterns include:
- Validating and restricting URL schemes, hostnames, resolved IP addresses, and ports before making requests
- Blocking loopback, link-local, private, and other prohibited address ranges, including after DNS resolution and redirects
- Applying destination-based network egress controls and protecting cloud metadata endpoints
- Using a restricted outbound proxy with explicit destination allowlists or deny rules
- Limiting which users can configure or execute workflows that make HTTP requests
- Applying least privilege to internal services and runtime identities, so network reachability alone does not grant authorization
How teams detect issues like this
High-level detection approaches include:
- Static analysis and code review for HTTP client calls that consume user-controlled URLs without destination validation
- Reviewing proxy and network policies for missing destination restrictions, including handling of redirects and DNS resolution
- Auditing remote-file, crawling, import, and workflow features for access controls and outbound-request constraints
- Monitoring outbound requests for unexpected access to private, loopback, link-local, or metadata address ranges
- Enforcing CI or deployment policies that require explicit egress rules and safe URL-fetching patterns

