-
-
Notifications
You must be signed in to change notification settings - Fork 69.1k
Feature request: add ssrfPolicy config for web_fetch (like browser has) #49444
Description
Problem
browser tool has a configurable ssrfPolicy in openclaw.json:
"browser": {
"ssrfPolicy": {
"allowPrivateNetwork": true,
"allowRfc2544BenchmarkRange": true,
"allowedHostnames": ["example.local"]
}
}However, web_fetch has no equivalent config — it hardcodes strict SSRF mode via withStrictGuardedFetchMode(), which passes no policy to fetchWithSsrFGuard().
Use Case
Home network with Surge (macOS proxy) acting as DHCP + DNS for all LAN devices. Surge uses fake-IP mode, resolving all domains to the RFC 2544 benchmark range (198.18.0.0/15). This causes web_fetch to block every URL that goes through Surge DNS, even for legitimate public websites.
The browser tool works fine because it has ssrfPolicy.dangerouslyAllowPrivateNetwork / allowRfc2544BenchmarkRange config options. But web_fetch has no such config, forcing users to patch source code.
Current Workaround
Patching withStrictGuardedFetchMode() in all bundled JS files to inject allowRfc2544BenchmarkRange: true into the policy. This needs to be re-applied after every openclaw update.
Proposed Solution
Add ssrfPolicy config under tools.web.fetch, mirroring the browser config schema:
"tools": {
"web": {
"fetch": {
"ssrfPolicy": {
"allowRfc2544BenchmarkRange": true
}
}
}
}The implementation would pass this policy through fetchWithWebToolsNetworkGuard() → fetchWithSsrFGuard() → resolvePinnedHostnameWithPolicy(), which already supports the full policy object.
Environment
- OpenClaw 2026.3.13
- Home LAN with Surge proxy (fake-IP mode, 198.18.0.0/15)
- Linux host (gateway mode: local)