openclaw - 💡(How to fix) Fix [Feature]: Allow configuring SSRF policy for web_fetch (allowRfc2544BenchmarkRange) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#63144Fetched 2026-04-09 07:57:52
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
1
Author
Participants
Timeline (top)
commented ×1

Allow users to configure the SSRF guard policy for web_fetch via openclaw.json, specifically the ability to whitelist RFC 2544 benchmark ranges (198.18.0.0/15) which are commonly used as "fake IP" addresses by transparent DNS proxies (e.g. Tailscale, Clash, OpenClash).

Root Cause

  • web_fetch calls fetchWithWebToolsNetworkGuard() without passing a custom ssrfPolicy
  • This defaults to strict mode where allowRfc2544BenchmarkRange is false
  • isBlockedSpecialUseIpv4Address() in ip-9u9YJphw.js line 158 returns true for 198.18.x.x unless allowRfc2544BenchmarkRange === true

Note: WEB_TOOLS_TRUSTED_NETWORK_SSRF_POLICY (with allowRfc2544BenchmarkRange: true) already exists in web-shared-CGUlqLIo.js line 263 but is only used by withTrustedWebToolsEndpoint(), which web_fetch does not call.

Fix Action

Fix / Workaround

  1. Always use withTrustedWebToolsEndpoint for web_fetch — Too permissive, also enables env proxy
  2. Disable fake-IP in router — Not always possible (shared network, ISP-level)
  3. External DoH-based fetch workaround — Works but lacks SSRF protection, skips cert verification, and doesn't integrate with OpenClaw's caching/proxy infrastructure

Code Example

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

---

{
  "tools": {
    "web": {
      "fetch": {
        "ssrfPolicy": {
          "allowRfc2544BenchmarkRange": true
        }
      }
    }
  }
}

---

const ssrfPolicy = config.tools?.web?.fetch?.ssrfPolicy;
const result = await fetchWithWebToolsNetworkGuard({
  url: params.url,
  maxRedirects: params.maxRedirects,
  timeoutSeconds: params.timeoutSeconds,
  lookupFn: params.lookupFn,
  policy: ssrfPolicy, // NEW: pass user-configured SSRF policy
  init: { ... }
});
RAW_BUFFERClick to expand / collapse

Summary

Allow users to configure the SSRF guard policy for web_fetch via openclaw.json, specifically the ability to whitelist RFC 2544 benchmark ranges (198.18.0.0/15) which are commonly used as "fake IP" addresses by transparent DNS proxies (e.g. Tailscale, Clash, OpenClash).

Problem to solve

When a transparent DNS proxy (fake-IP mode) resolves all DNS queries to addresses in the 198.18.0.0/15 range, web_fetch fails with:

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

This affects users running OpenClaw behind routers/proxies with fake-IP DNS (very common in China and other regions). The entire web_fetch tool becomes unusable for any overseas domain.

Root cause analysis

  • web_fetch calls fetchWithWebToolsNetworkGuard() without passing a custom ssrfPolicy
  • This defaults to strict mode where allowRfc2544BenchmarkRange is false
  • isBlockedSpecialUseIpv4Address() in ip-9u9YJphw.js line 158 returns true for 198.18.x.x unless allowRfc2544BenchmarkRange === true

Note: WEB_TOOLS_TRUSTED_NETWORK_SSRF_POLICY (with allowRfc2544BenchmarkRange: true) already exists in web-shared-CGUlqLIo.js line 263 but is only used by withTrustedWebToolsEndpoint(), which web_fetch does not call.

Proposed solution

Add a config option in openclaw.json under tools.web.fetch:

{
  "tools": {
    "web": {
      "fetch": {
        "ssrfPolicy": {
          "allowRfc2544BenchmarkRange": true
        }
      }
    }
  }
}

Implementation: In the web_fetch tool handler (pi-embedded-yhO3edNd.js ~line 16158), read the SSRF policy from config and pass it to fetchWithWebToolsNetworkGuard():

const ssrfPolicy = config.tools?.web?.fetch?.ssrfPolicy;
const result = await fetchWithWebToolsNetworkGuard({
  url: params.url,
  maxRedirects: params.maxRedirects,
  timeoutSeconds: params.timeoutSeconds,
  lookupFn: params.lookupFn,
  policy: ssrfPolicy, // NEW: pass user-configured SSRF policy
  init: { ... }
});

This would allow users who know they're behind a fake-IP proxy to opt-in to allowing 198.18.x.x ranges, while keeping the default secure behavior unchanged.

Alternatives considered

  1. Always use withTrustedWebToolsEndpoint for web_fetch — Too permissive, also enables env proxy
  2. Disable fake-IP in router — Not always possible (shared network, ISP-level)
  3. External DoH-based fetch workaround — Works but lacks SSRF protection, skips cert verification, and doesn't integrate with OpenClaw's caching/proxy infrastructure

Impact

  • Affected: Users behind transparent DNS proxies (fake-IP mode), particularly common in China with OpenClash/Tailscale
  • Severity: Blocks workflow — web_fetch completely broken for overseas domains
  • Frequency: Always affected when fake-IP DNS is active

Additional information

  • Must remain backward-compatible: default behavior should stay strict (block 198.18.x.x)
  • Only users who explicitly set allowRfc2544BenchmarkRange: true should be affected
  • Consider documenting this option in the web_fetch tool description when enabled
  • Environment: OpenClaw v2026.4.7 on Kali GNU/Linux Rolling

extent analysis

TL;DR

To fix the web_fetch issue behind transparent DNS proxies, add a configuration option to openclaw.json to allow the RFC 2544 benchmark range.

Guidance

  • Add the following configuration to openclaw.json:
{
  "tools": {
    "web": {
      "fetch": {
        "ssrfPolicy": {
          "allowRfc2544BenchmarkRange": true
        }
      }
    }
  }
}
  • Update the web_fetch tool handler to read the SSRF policy from the configuration and pass it to fetchWithWebToolsNetworkGuard().
  • Verify that web_fetch can successfully fetch overseas domains after applying the configuration change.
  • Consider documenting the new configuration option in the web_fetch tool description.

Example

The updated web_fetch tool handler code would look like this:

const ssrfPolicy = config.tools?.web?.fetch?.ssrfPolicy;
const result = await fetchWithWebToolsNetworkGuard({
  url: params.url,
  maxRedirects: params.maxRedirects,
  timeoutSeconds: params.timeoutSeconds,
  lookupFn: params.lookupFn,
  policy: ssrfPolicy, 
  init: { ... }
});

Notes

This solution assumes that the openclaw.json configuration file is properly read and applied by the OpenClaw application. Additionally, this change should only affect users who explicitly set allowRfc2544BenchmarkRange: true in their configuration.

Recommendation

Apply the proposed workaround by adding the configuration option to openclaw.json and updating the web_fetch tool handler. This solution allows users to opt-in to allowing the RFC 2544 benchmark range while keeping the default secure behavior unchanged.

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