openclaw - 💡(How to fix) Fix [Feature] Add configurable SSRF policy for web_fetch (parity with browser tool) [1 comments, 2 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#55058Fetched 2026-04-08 01:33:08
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1
  • FakeIP is a common proxy mode in tools like Clash, Surge, Shadowrocket, etc.
  • The 198.18.0.0/15 range is used as FakeIP pool by default in most implementations
  • browser tool already handles this via ssrfPolicy.dangerouslyAllowPrivateNetwork
  • tavily_extract works as a workaround (server-side fetch), but web_fetch is the primary tool for URL content extraction

Root Cause

The request never reaches the proxy because web_fetch rejects the resolved IP before making the HTTP call.

Fix Action

Fix / Workaround

  • FakeIP is a common proxy mode in tools like Clash, Surge, Shadowrocket, etc.
  • The 198.18.0.0/15 range is used as FakeIP pool by default in most implementations
  • browser tool already handles this via ssrfPolicy.dangerouslyAllowPrivateNetwork
  • tavily_extract works as a workaround (server-side fetch), but web_fetch is the primary tool for URL content extraction

Code Example

// browser already has this:
"browser": {
  "ssrfPolicy": {
    "dangerouslyAllowPrivateNetwork": true,
    "allowedHostnames": ["example.com"]
  }
}

---

"tools": {
  "web": {
    "fetch": {
      "ssrfPolicy": {
        "dangerouslyAllowPrivateNetwork": true
        // or allowedHostnames / allowedCIDRs
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

web_fetch has a hardcoded SSRF check that blocks requests to private/reserved IP ranges. This conflicts with FakeIP proxy mode (used by Clash, Surge, and similar transparent proxies), where DNS intentionally returns reserved IPs (e.g. 198.18.x.x) as placeholders — actual traffic is intercepted and forwarded by the proxy at the network layer.

The request never reaches the proxy because web_fetch rejects the resolved IP before making the HTTP call.

Current behavior

  • web_fetch resolves DNS → gets 198.18.x.x → blocks as private/reserved IP → request fails
  • No configuration option exists to disable or customize this check

Expected behavior

web_fetch should support a configurable SSRF policy, similar to what the browser tool already provides:

// browser already has this:
"browser": {
  "ssrfPolicy": {
    "dangerouslyAllowPrivateNetwork": true,
    "allowedHostnames": ["example.com"]
  }
}

Proposed solution

Add SSRF policy configuration under tools.web.fetch (or a shared top-level ssrfPolicy), for example:

"tools": {
  "web": {
    "fetch": {
      "ssrfPolicy": {
        "dangerouslyAllowPrivateNetwork": true
        // or allowedHostnames / allowedCIDRs
      }
    }
  }
}

Key points:

  • SSRF protection should remain enabled by default (no security regression)
  • Users in FakeIP environments can opt in to allow private IPs
  • Ideally share the same policy schema as browser.ssrfPolicy for consistency

Context

  • FakeIP is a common proxy mode in tools like Clash, Surge, Shadowrocket, etc.
  • The 198.18.0.0/15 range is used as FakeIP pool by default in most implementations
  • browser tool already handles this via ssrfPolicy.dangerouslyAllowPrivateNetwork
  • tavily_extract works as a workaround (server-side fetch), but web_fetch is the primary tool for URL content extraction

Environment

  • OpenClaw version: 2026.3.23-2
  • OS: macOS (arm64)
  • Network: transparent proxy with FakeIP mode

extent analysis

Fix Plan

To address the issue, we need to add a configurable SSRF policy to web_fetch. Here are the steps:

  • Add a new configuration option ssrfPolicy under tools.web.fetch with the following properties:
    • dangerouslyAllowPrivateNetwork: a boolean flag to allow or block private IP ranges
    • allowedHostnames: an array of allowed hostnames
    • allowedCIDRs: an array of allowed CIDR ranges
  • Update the web_fetch implementation to respect the new ssrfPolicy configuration
  • Set dangerouslyAllowPrivateNetwork to true by default for users in FakeIP environments

Example configuration:

"tools": {
  "web": {
    "fetch": {
      "ssrfPolicy": {
        "dangerouslyAllowPrivateNetwork": true,
        "allowedHostnames": ["example.com"],
        "allowedCIDRs": ["198.18.0.0/15"]
      }
    }
  }
}

Example code snippet (in JavaScript):

const ssrfPolicy = config.tools.web.fetch.ssrfPolicy;
if (ssrfPolicy.dangerouslyAllowPrivateNetwork) {
  // allow private IP ranges
} else {
  // block private IP ranges
}

Verification

To verify the fix, test web_fetch with the new ssrfPolicy configuration and ensure that it allows or blocks private IP ranges as expected.

Extra Tips

  • Make sure to document the new ssrfPolicy configuration option and its properties
  • Consider sharing the same policy schema as browser.ssrfPolicy for consistency
  • Test the fix thoroughly to ensure that it does not introduce any security regressions

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…

FAQ

Expected behavior

web_fetch should support a configurable SSRF policy, similar to what the browser tool already provides:

// browser already has this:
"browser": {
  "ssrfPolicy": {
    "dangerouslyAllowPrivateNetwork": true,
    "allowedHostnames": ["example.com"]
  }
}

Still need to ship something?

×6

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

Back to top recommendations

TRENDING