Summary
Server-side request forgery in the Crawl4AI Docker API arises from incomplete CIDR-based URL validation that fails to properly handle all IPv4/IPv6 address forms.
Under these conditions, an attacker can coerce the API server into issuing HTTP requests to internal services and cloud metadata endpoints, especially when the default unauthenticated mode is enabled.
Affected context
The vulnerability occurs in Crawl4AI deployments that expose the Docker API server with webhook or URL-based actions.
It is relevant where:
- The Docker API is reachable over the network
jwt_enabledis false or otherwise not enforcing strong authentication- URL validation relies on a CIDR blocklist and does not correctly normalize or interpret all IPv4/IPv6 representations
In such environments, crafted destination URLs can bypass SSRF filters and reach sensitive internal endpoints.
Exploit preconditions
- Attack surface: Network-exposed Docker API server in Crawl4AI
- Required access: Ability to submit or influence webhook URLs or destination URLs; no credentials needed when
jwt_enabled: false - Trigger point: URL validation routines (
validate_webhook_url/validate_url_destination) before the server issues outbound HTTP requests - Why exploitation is possible: The SSRF protection uses an explicit CIDR blocklist that does not account for IPv4 addresses embedded in IPv6 transition forms, the IPv6 unspecified address, and other edge representations, allowing internal targets to be encoded in ways the filter fails to recognize.
Why this happens
The core issue is an incomplete SSRF defense that relies on ad-hoc IP blocklisting rather than robust normalization and strict allowlisting of destinations.
By focusing on specific IPv4/IPv6 CIDR ranges without consistently canonicalizing addresses and handling all address families, the validation logic misclassifies certain crafted URLs as safe.
This aligns with CWE-918: Server-Side Request Forgery (SSRF), where a server-side component performs network requests on behalf of an attacker to unintended internal or privileged endpoints.
Potential impact
- Access to cloud instance metadata services, which may expose tokens or credentials
- Interaction with internal HTTP services not intended to be reachable externally
- Discovery or probing of internal network topology through response observation
- Potential lateral movement if internal APIs accept requests from the Docker API host
- Expansion of impact when combined with other vulnerabilities on accessed internal services
General mitigation guidance
Effective mitigation focuses on reducing trust in user-controlled URLs and constraining where server-side requests can go.
Common defensive patterns include:
- Prefer strict allowlists of domains or services instead of CIDR-based blocklists
- Canonicalize and normalize IP addresses and hostnames before applying any checks
- Reject raw IP literals, unusual IPv6 forms, and ambiguous address notations unless explicitly required
- Separate responsibilities so that crawler components cannot directly reach infrastructure control or metadata endpoints
- Enforce authentication, authorization, and least privilege for any API issuing outbound requests on behalf of users
How teams detect issues like this
Organizations can detect similar SSRF risks by:
- Applying static analysis or linters to flag custom URL validators that rely solely on blocklists or incomplete IP checks
- Reviewing code for patterns where user-supplied URLs are passed into HTTP client libraries without strong destination constraints
- Implementing security tests that attempt IPv4-mapped IPv6, unspecified, and other edge-case addresses against URL filters
- Enforcing architectural policies requiring outbound request components to use vetted URL resolution and destination-allowlisting libraries

