Summary
RAGFlow's Agent "Invoke" component can construct outbound URLs from canvas settings and runtime template values without applying the platform's URL safety checks. An attacker who can create or trigger an agent, or influence an interpolated chat query, may cause the server to access internal services and receive their responses.
Affected context
The vulnerability occurs in RAGFlow deployments using the Agent workflow "Invoke" component before the affected security behavior was corrected. It is relevant when the component accepts a URL from canvas configuration or runtime variables and sends requests without validating the destination or binding the resolved address to an approved network location. Risk is higher when users can create or trigger agents, or when chat input is interpolated into the request URL.
Exploit preconditions
- Attack surface: The server-side HTTP client used by the Agent "Invoke" component
- Required access: Ability to create or trigger an agent, or to provide input that affects an interpolated request URL
- Trigger point: Execution of an Invoke workflow step that performs an outbound GET, POST, or PUT request
- Why exploitation is possible: The destination is accepted without the shared URL safety validation and address-pinning controls applied to other fetch paths, allowing requests toward internal or otherwise restricted network locations
Why this happens
The component passes a URL assembled from configuration and runtime template values directly to an outbound HTTP client without enforcing a trusted destination policy. This insecure pattern allows server-side request targets to be selected or influenced by untrusted input and may permit access to loopback, link-local, private-network, or cloud metadata addresses.
This behavior maps to CWE-918: Server-Side Request Forgery, in which a server is induced to issue requests to resources that the external requester may not be able to access directly. Validation that checks only the textual URL, without controlling redirects and pinning the resolved destination, may also leave network-boundary protections incomplete.
Potential impact
- An attacker may retrieve cloud instance metadata or service credentials.
- The server could access administrative interfaces and services on loopback or private networks.
- Sensitive response bodies may be returned through the agent output.
- Internal services could receive unauthorized GET, POST, or PUT requests.
- An attacker could use the deployment as a bridge for network reconnaissance or further compromise.
General mitigation guidance
Mitigation generally focuses on treating all Invoke destinations and interpolated URL values as untrusted.
Common defensive patterns include:
- Reusing a centralized SSRF-safe URL validation policy for every outbound request path.
- Allowlisting approved schemes, hosts, ports, and network destinations rather than relying on deny lists alone.
- Resolving hostnames and pinning the connection to the validated address to reduce DNS rebinding and resolution changes.
- Restricting or disabling redirects unless each redirect destination is independently validated.
- Separating user-controlled template values from request destinations where possible.
- Applying egress network controls that block loopback, link-local, private, and metadata ranges unless explicitly required.
- Running the application with least-privilege network access and limiting the sensitivity of credentials exposed to its runtime.
How teams detect issues like this
Detection approaches commonly include:
- Static analysis rules identifying outbound HTTP calls whose URL arguments derive from request data, templates, canvas configuration, or agent state without a shared validation wrapper.
- Code review checks for direct use of HTTP client methods, missing destination allowlists, unrestricted redirects, and lack of resolved-address pinning.
- Tests that exercise loopback, link-local, RFC 1918, IPv6 local, metadata, redirect, and DNS-rebinding destinations in isolated environments.
- Egress firewall, proxy, and DNS monitoring for unexpected requests from RAGFlow workers to internal services or cloud metadata endpoints.
- Policy enforcement requiring security-reviewed outbound request helpers for components that process user-controlled values.
Automated application-security review tools may help identify direct request construction and missing SSRF safeguards, but findings should be verified against deployment network policy.

