Repository navigation
Description
Summary
In a Mihomo/OpenClash fake-ip network, web_fetch still fails for ordinary external URLs like https://huggingface.co with:
Blocked: resolves to private/internal/special-use IP address
This still happens on a recent OpenClaw build even after configuring openclaw-gateway to run with HTTP_PROXY / HTTPS_PROXY and verifying those env vars are present in the live gateway process.
From a user perspective, the current behavior is confusing because recent changelog entries suggest improved support for:
- RFC2544 fake-IP compatibility
- proxy-aware SSRF guard paths
- trusted env-proxy routing for web tools
But in practice, a normal web_fetch target such as Hugging Face still appears to stay on the strict pinned-DNS path and gets blocked in a common fake-ip deployment.
Environment
- OpenClaw gateway version:
2026.4.1 - OS: Linux
- Upstream network: OpenClash / Mihomo with
fake-ip - Fake-IP range involved:
198.18.0.0/15 - Explicit gateway proxy configured via user systemd drop-in:
HTTP_PROXY=http://127.0.0.1:7897HTTPS_PROXY=http://127.0.0.1:7897ALL_PROXY=http://127.0.0.1:7897NO_PROXY=127.0.0.1,localhost,::1
What I verified
- OpenClaw is already on a recent version (
2026.4.1), so this does not appear to be an "old version" problem. openclaw-gatewayis actually running with the proxy env vars:- confirmed in
systemctl --user cat openclaw-gateway.service - confirmed again in
/proc/<pid>/environ
- confirmed in
openclaw gateway statusreports the gateway is healthy and reachable (RPC probe: ok).- The local proxy endpoint itself is reachable and working (
http://127.0.0.1:7897). - Despite all of the above,
web_fetchstill fails forhttps://huggingface.cowith the SSRF/private-address error.
Reproduction
- Put the machine behind Mihomo / OpenClash with
fake-ipenabled. - Configure
openclaw-gatewaywith explicit env proxy variables (HTTP_PROXY/HTTPS_PROXY). - Restart the gateway and verify the env vars are present in the running process.
- Call
web_fetchon:https://huggingface.co
Actual result
web_fetch fails with:
Blocked: resolves to private/internal/special-use IP address
Expected result
One of these should be true:
web_fetchshould successfully work for common public targets in fake-ip deployments when the gateway is correctly configured with a trusted env proxy, or- the docs/config should clearly expose the intended user-facing mechanism for this case (for example, a documented trusted-domain / allowlist path for
web_fetch).
Additional findings from local source inspection
From local source/tests in the OpenClaw repo, this behavior appears related to the fact that ordinary / untrusted web_fetch URLs still keep strict DNS pinning even when HTTP_PROXY is configured.
In other words, the current trusted env-proxy path seems to exist, but not in a way that solves this user-facing case for normal external fetch targets behind fake-ip.
Questions
- Is this current behavior expected, or is it a bug / missing piece?
- What is the officially recommended solution for
web_fetchbehind Mihomo/OpenClash fake-ip when users need to fetch normal public sites like Hugging Face? - Should OpenClaw expose a documented user-facing allowlist / trusted-domains mechanism for
web_fetchspecifically?
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
cosmicnet commentedon Apr 11, 2026
Related: PR #58034 is aimed at the same user-facing gap.
The approach there is not to make ordinary
web_fetchautomatically trustHTTP_PROXY/HTTPS_PROXY, but to expose a documented explicit opt-in:tools.web.fetch.useTrustedEnvProxy. When enabled,web_fetchcan take the trusted env proxy path for matching HTTP(S) proxy envs, withNO_PROXYfallback and pre-dispatch hostname checks preserved. So if the intended answer here is "provide a narrow, documented proxy mode for web_fetch", that PR is directly relevant.Maybe you can test if that branch fixes your issue?
steipete commentedon Apr 25, 2026
Closing this as implemented after Codex review.
Current
mainalready implements an explicit fake-IP-compatibleweb_fetchpath viatools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange, wires that opt-in into the SSRF guard, and records it as shipped inv2026.4.10, so the reported gap is now implemented.What I checked:
2026.4.10changelog section includes aweb_fetchfix for fake-IP environments: an opt-intools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRangeso sites resolved into198.18.0.0/15can be fetched without weakening the default SSRF block. (CHANGELOG.md:975, 6bc0dc8fb671)tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRangeis part of the current tool config type, with help text explicitly calling out fake-IP compatibility for Clash/Surge-style setups. (src/config/types.tools.ts:561, 6bc0dc8fb671)runWebFetchreads the opt-in and passes{ allowRfc2544BenchmarkRange: true }into the guarded fetch policy for the actual request path. (src/agents/tools/web-fetch.ts:390, 6bc0dc8fb671)allowRfc2544BenchmarkRangeinto the IPv4 special-use checks instead of broadly disabling private-network blocking. (src/infra/net/ssrf.ts:100, 6bc0dc8fb671)web_fetchstays on strict pinned-DNS behavior by default even whenHTTP_PROXYis set, and the fake-IP opt-in allows RFC2544 benchmark-range targets only when explicitly enabled. (src/agents/tools/web-tools.fetch.test.ts:256, 6bc0dc8fb671)So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review notes: reviewed against 6bc0dc8fb671; fix evidence: release v2026.4.10.