openclaw - ✅(Solved) Fix web_fetch SSRF blocks RFC 2544 (198.18.0.0/15) used by transparent-proxy VPNs (Shadowrocket/Surge/Clash) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68192Fetched 2026-04-18 05:53:33
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Error Message

Error: SsrFBlockedError: Blocked: resolves to private/internal/special-use IP address

Root Cause

These VPNs resolve every hostname to a virtual IP in 198.18.0.0/15 (RFC 2544 Benchmarking range), then route traffic through their tunnel interface. The OS kernel routes 198.18.x.xutunN → VPN does real DNS + proxy forwarding. curl and browsers work fine because they use the system network stack.

Fix Action

Fixed

PR fix notes

PR #68203: feat(web-fetch): added Stealth Mode – new privacy and VPN-resilient functionality

Description (problem / solution / changelog)

Implemented Stealth Mode for the core tool.

This new mode of functionality:

  • Automatically opts into the RFC 2544 benchmark range (198.18.0.0/15) to support transparent-proxy VPNs (Shadowrocket, Surge, Clash, etc.)
  • Switches to a privacy-focused randomized User-Agent
  • Makes OpenClaw far more robust in restricted or privacy-conscious network environments

Closes #68192.

Changed files

  • src/agents/tools/web-fetch.ts (modified, +15/-4)

Code Example

tools:
  web:
    fetch:
      ssrfPolicy:
        allowRfc2544BenchmarkRange: true
RAW_BUFFERClick to expand / collapse

Problem

web_fetch (and pdf tool) fails on all external URLs when the host runs a transparent-proxy VPN (Shadowrocket, Surge, Clash, Mihomo) in packet-tunnel / fake-IP mode.

These VPNs resolve every hostname to a virtual IP in 198.18.0.0/15 (RFC 2544 Benchmarking range), then route traffic through their tunnel interface. The OS kernel routes 198.18.x.xutunN → VPN does real DNS + proxy forwarding. curl and browsers work fine because they use the system network stack.

However, web_fetch resolves DNS → gets 198.18.x.x → SSRF check identifies it as a special-use address → blocks the request before it reaches the network stack.

Error: SsrFBlockedError: Blocked: resolves to private/internal/special-use IP address

This has been silently breaking web_fetch for over a month across many domains (arxiv.org, xhscdn.com, resources.anthropic.com, etc.).

Evidence from source code

The codebase already handles this case in two places:

  1. ip-*.js: isBlockedSpecialUseIpv4Address() has an explicit allowRfc2544BenchmarkRange option that skips the 198.18.0.0/15 check
  2. Telegram channel: channels.telegram.network.dangerouslyAllowPrivateNetwork is documented and works — Telegram media downloads already allow RFC 2544 by default

But web_fetch calls fetchWithWebToolsNetworkGuard() without passing any policy or useEnvProxy, so it always uses strict mode with no way to opt in.

Verification

Tested on the same host:

  • curl → works, exit IP matches VPN
  • Node.js raw https.request() to 198.18.x.x → works, same exit IP as curl (traffic goes through VPN tunnel)
  • web_fetch → blocked by SSRF check before traffic reaches the network stack

This confirms that allowing 198.18.x.x does not bypass the VPN — the kernel routes it through the tunnel regardless.

Proposed solution

Add an SSRF policy option under tools.web.fetch, similar to what browser.ssrfPolicy and Telegram channel already have:

tools:
  web:
    fetch:
      ssrfPolicy:
        allowRfc2544BenchmarkRange: true

Or a simpler top-level network policy that applies to all web tools.

The allowRfc2544BenchmarkRange flag already exists in the SSRF check logic — it just needs to be wired to a user-facing config for web_fetch.

Environment

  • OpenClaw installed via npm (latest)
  • macOS, VPN in packet-tunnel / fake-IP mode
  • VPN creates a utun interface with 198.18.0.1 gateway and global route override (0/1 + 128/1)
  • All DNS queries return 198.18.x.x virtual IPs

extent analysis

TL;DR

Add an SSRF policy option to tools.web.fetch to allow RFC 2544 benchmark range addresses.

Guidance

  • Verify that the allowRfc2544BenchmarkRange flag is correctly implemented in the SSRF check logic.
  • Add a configuration option to tools.web.fetch to enable the allowRfc2544BenchmarkRange flag, similar to the proposed solution.
  • Test the updated configuration with web_fetch to ensure it can resolve external URLs through the VPN tunnel.
  • Consider adding a top-level network policy that applies to all web tools for consistency.

Example

tools:
  web:
    fetch:
      ssrfPolicy:
        allowRfc2544BenchmarkRange: true

This configuration allows web_fetch to resolve external URLs through the VPN tunnel by enabling the allowRfc2544BenchmarkRange flag.

Notes

The proposed solution relies on the existing allowRfc2544BenchmarkRange flag in the SSRF check logic. If this flag is not correctly implemented, additional debugging may be required.

Recommendation

Apply the workaround by adding the proposed SSRF policy option to tools.web.fetch, as it allows web_fetch to resolve external URLs through the VPN tunnel without compromising security.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING