Summary
CrewAI contains a server-side request forgery issue in its URL validation logic, where URLs are validated once and then used unchanged.
By abusing redirects or DNS rebinding, an attacker can coerce the server into making requests to internal services or cloud metadata endpoints, potentially exposing sensitive data or internal network behavior.
Affected context
This vulnerability affects deployments of CrewAI that rely on the validate_url function to enforce network egress restrictions for server-initiated HTTP requests.
The issue is most relevant when the application accepts user-supplied URLs and then makes outbound requests on behalf of users, such as fetching remote resources, calling webhooks, or integrating with third-party APIs.
Environments with accessible internal services, service meshes, or cloud instance metadata endpoints are at particular risk when the validated URL is later requested by backend components.
Exploit preconditions
- Attack surface: Any CrewAI feature or integration path that accepts user-controlled URLs and causes the backend to perform HTTP requests to those URLs.
- Required access: Ability to supply or influence the target URL (e.g., via API parameters, configuration fields, or workflow definitions).
- Trigger point: The backend uses the URL after a one-time
validate_urlcheck that does not account for redirects or changes in DNS resolution. - Why exploitation is possible: The validation logic performs a single DNS resolution and blocklist check on the initially supplied hostname, then returns the original URL unchanged, allowing redirections or DNS rebinding to point subsequent requests to internal IP ranges or metadata services.
Why this happens
The core issue is a flawed trust model around network destinations, aligning with CWE-918: Server-Side Request Forgery (SSRF).
The validate_url function performs a one-shot DNS lookup and blocklist comparison only on the initial URL and then passes that original URL forward for later use.
Because the actual network request may follow redirects or be affected by DNS rebinding, the eventual destination can differ from what was validated, breaking the assumption that a single pre-request check is sufficient.
This design treats user-controlled URLs as trustworthy after minimal validation rather than enforcing strict, end-to-end control over the effective request target.
Potential impact
- Access to internal HTTP services not directly exposed to the internet
- Retrieval of cloud instance metadata (e.g., temporary credentials, tokens, or configuration)
- Network scanning or probing of internal IP ranges from the server's perspective
- Bypassing network segmentation or firewall controls by pivoting through the application server
- Potential exposure of sensitive configuration data or service endpoints
General mitigation guidance
Effective mitigation centers on constraining outbound requests and correctly validating the final destination of any server-side HTTP call.
Common defensive patterns include:
- Enforcing allowlists of hostnames or domains and resolving them at request time, not just at initial validation.
- Blocking requests to private, link-local, loopback, and metadata address ranges at the networking or HTTP client layer.
- Disabling or strictly limiting automatic redirects for requests that originate from user-supplied URLs, or re-validating the destination after each redirect.
- Using network-level egress controls (e.g., firewall rules, VPC egress policies, service mesh policies) so application servers cannot reach sensitive internal or metadata endpoints.
- Treating all user-supplied URLs as untrusted and normalizing and parsing them with robust URL parsing utilities before use.
How teams detect issues like this
Detection strategies generally focus on identifying SSRF patterns in code and monitoring runtime behavior:
- Static analysis rules that flag server-side HTTP calls using user-controlled URLs without strict allowlists or IP range checks.
- Code review checklists that require verification of URL validation logic, redirect handling, and DNS resolution practices.
- Centralized HTTP client wrappers or network gateways that log, restrict, and alert on requests to internal or metadata IP ranges.
- Runtime monitoring and IDS/IPS rules that detect unusual outbound connections from application servers to internal infrastructure or cloud metadata endpoints.
- Use of security scanning tools that simulate SSRF probes and DNS rebinding scenarios to validate defenses.

