Summary
OpenClaw's server-side request forgery (SSRF) protections can be bypassed by encoding loopback and internal IP addresses as full-form IPv4-mapped IPv6 literals (for example, 0:0:0:0:0:ffff:7f00:1 for 127.0.0.1).
Under these conditions, an attacker can coerce the assistant into making HTTP requests to internal or metadata endpoints that are supposed to be blocked by the SSRF guard.
Affected context
This vulnerability appears in OpenClaw deployments where the assistant can be instructed—directly or indirectly—to fetch URLs supplied or influenced by an external party.
The issue arises when the SSRF guard checks and blocks loopback, private, or link-local targets based on canonical IPv4 or hostname formats, but does not correctly recognize those same targets when expressed as full-form IPv4-mapped IPv6 literals.
Environments that expose internal HTTP services or cloud instance metadata endpoints become particularly susceptible when reachable from the OpenClaw runtime network.
Exploit preconditions
- Attack surface: Any feature where OpenClaw performs outbound HTTP/HTTPS requests based on user-controlled or user-influenced URLs (e.g., web browsing, tool plugins, webhooks, URL enrichment).
- Required access: Ability to supply or manipulate a URL that OpenClaw will request; no direct network access to the target internal service is required.
- Trigger point: Submission of a specially crafted IPv4-mapped IPv6 literal that encodes a loopback, private, or metadata IP address (for example,
0:0:0:0:0:ffff:7f00:1) as the request destination. - Why exploitation is possible: The SSRF guard logic performs insufficient normalization and address classification, treating IPv4-mapped IPv6 literals as benign external addresses, thereby failing to block requests to protected network ranges.
Why this happens
The root cause is an incomplete SSRF defense that assumes IP addresses will be expressed in conventional IPv4 or simplified IPv6 formats and does not normalize or re-interpret IPv4-mapped IPv6 literals before applying allow/deny rules.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where server-side HTTP clients are insufficiently constrained and can be steered toward internal or sensitive endpoints.
Conceptually, the URL validation logic performs pattern-based checks (e.g., string or simple range checks) against the raw address rather than using a canonicalized, parsed network representation, leaving alternative encodings like ::ffff:127.0.0.1 or its fully expanded variants outside the blocklist.
Potential impact
- Access to loopback-only HTTP services (e.g., admin panels, debuggers, local APIs) via the OpenClaw runtime.
- Retrieval of cloud instance metadata from link-local endpoints, which may expose credentials, tokens, or configuration secrets.
- Interaction with internal microservices on private address space, potentially enabling privilege escalation or data exfiltration.
- Use of OpenClaw as a blind proxy to perform network reconnaissance on internal infrastructure.
- Facilitation of further attacks if responses from internal services are surfaced back to the attacker in any form.
General mitigation guidance
Effective mitigation centers on robust network and URL validation that is independent of superficial string formats:
- Normalize and parse all destination hosts and IPs using a hardened network library, resolving to a canonical representation before applying SSRF rules.
- Classify IP addresses based on their numeric form (loopback, private, link-local, multicast) and block or strictly limit requests to those categories by default.
- Treat IPv4-mapped IPv6 and other alternative encodings (compressed IPv6, different notations) as equivalent to their underlying IPv4 addresses when enforcing policies.
- Apply a default-deny posture for internal ranges, only allowing explicitly enumerated external endpoints or well-defined egress policies where feasible.
- Consider defense-in-depth with network-level controls (firewalls, egress filters) so that even if application-layer SSRF checks fail, direct access to sensitive metadata or internal services remains restricted.
How teams detect issues like this
High-level detection of this issue and similar SSRF weaknesses can include:
- Static analysis and code review:
- Identify components that construct outbound HTTP/HTTPS requests based on external input.
- Look for custom URL validation or IP checks that operate on raw strings instead of fully parsed address objects.
- Flag code paths that do not explicitly evaluate IPv4-mapped IPv6, loopback, and private ranges via numeric comparison.
- Dynamic testing and fuzzing:
- Use security testing to supply URLs with variant encodings of internal addresses (compressed IPv6, IPv4-embedded IPv6, encoded hostnames) to confirm that SSRF guards block them consistently.
- Monitor whether requests to known internal test endpoints are possible via OpenClaw features.
- Operational monitoring:
- Inspect outbound logs from the OpenClaw runtime for unusual requests to
127.0.0.0/8,10.0.0.0/8,169.254.169.254, and their IPv6/IPv4-mapped equivalents. - Set alerts on attempts to reach cloud metadata endpoints or other sensitive internal resources from application containers.
- Automated review tools and SAST/DAST platforms can assist by highlighting potentially unsafe URL fetch patterns and incomplete SSRF protections.

