fix(web-fetch): expose ssrfPolicy.allowRfc2544BenchmarkRange config option#25258
Closed
byungsker wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(web-fetch): expose ssrfPolicy.allowRfc2544BenchmarkRange config option#25258byungsker wants to merge 1 commit intoopenclaw:mainfrom
byungsker wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…ption web_fetch unconditionally applied the SSRF block list, which includes the RFC 2544 benchmark range (198.18.0.0/15). Clash/mihomo and similar proxy tools use this range for their fake-ip mode: DNS queries return virtual IPs in 198.18.x.x that are transparently forwarded to the real destination by the kernel. The block made web_fetch completely unusable for these users after the RFC 2544 check was added in 2026.2.22-2. The underlying SsrFPolicy.allowRfc2544BenchmarkRange option already existed (used by the Telegram delivery path), and was partially wired into the web_fetch tool. However, ToolsWebFetchSchema used .strict() without including ssrfPolicy, so the config field was rejected at validation time with 'Unrecognized key: ssrfPolicy'. Fix: - Add ssrfPolicy, readability, and firecrawl to ToolsWebFetchSchema (all three were present in types.tools.ts and schema.help.ts but missing from the Zod validation schema, causing config rejections) - Wire ssrfPolicy.allowRfc2544BenchmarkRange through to fetchWithSsrFGuard - Add schema help and labels for tools.web.fetch.ssrfPolicy - Add config regression tests for ssrfPolicy, readability, and firecrawl When tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange is true, the 198.18.0.0/15 range is allowed; all other SSRF protections (private IPs, loopback, cloud-metadata hostnames, etc.) remain active. Fixes openclaw#25215
d09286d to
41ab60b
Compare
This was referenced Feb 25, 2026
|
This would fix #25215 for us — we run Clash/mihomo in fake-ip mode and had to pin an older version to work around the SSRF block. Clean approach exposing it as a config option. 👍 |
|
This fix is critical for many users in China who rely on Clash/mihomo with fake-ip mode. The web_fetch tool is completely unusable without this. Hope this can be merged soon! Thanks for the clean implementation. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This fix is critical for many users in China who rely on Clash/mihomo with fake-ip mode. The web_fetch tool is completely unusable without this. Hope this can be merged soon! Thanks for the clean implementation. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
web_fetchunconditionally applied the SSRF block list including the RFC 2544 benchmark range (198.18.0.0/15). Clash/mihomo and similar proxy tools use this range for fake-ip mode: DNS queries return virtual IPs in198.18.x.xthat are transparently forwarded to the real destination by the kernel.This made
web_fetchcompletely unusable for users running a local proxy after the RFC 2544 check was added in 2026.2.22-2.Furthermore, even though
SsrFPolicy.allowRfc2544BenchmarkRangealready existed and partial wiring was inweb-fetch.ts, theToolsWebFetchSchemaZod schema used.strict()without includingssrfPolicy— so the config field was silently rejected at validation time with:Additionally,
readabilityandfirecrawlsub-config were in the same situation: present intypes.tools.tsandschema.help.tsbut missing fromToolsWebFetchSchema, causing config validation failures.Fixes #25215
Changes
src/config/zod-schema.agent-runtime.ts— AddssrfPolicy,readability, andfirecrawltoToolsWebFetchSchema(all three caused unrecognized-key errors due to.strict())src/agents/tools/web-fetch.ts— WiressrfPolicy.allowRfc2544BenchmarkRangethrough tofetchWithSsrFGuardsrc/config/types.tools.ts— TypeScript type for the new config fieldsrc/config/schema.help.ts— Help text fortools.web.fetch.ssrfPolicyandtools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRangesrc/config/schema.labels.ts— UI labels for the new ssrfPolicy fieldssrc/agents/tools/web-fetch.ssrf.test.ts— Tests for RFC 2544 range allow/block behaviorsrc/config/config.schema-regressions.test.ts— Config regression tests forssrfPolicy,readability, andfirecrawlConfig
Users running Clash/mihomo in fake-ip mode can now add to their config:
{ "tools": { "web": { "fetch": { "ssrfPolicy": { "allowRfc2544BenchmarkRange": true } } } } }When enabled, the
198.18.0.0/15range is permitted forweb_fetch; all other SSRF protections (private IPs, loopback, cloud-metadata hostnames, etc.) remain active.Greptile Summary
Added
ssrfPolicy.allowRfc2544BenchmarkRangeconfig option to fixweb_fetchcompatibility with Clash/mihomo proxy fake-ip mode, and fixed schema validation bugs that were silently rejectingssrfPolicy,readability, andfirecrawlconfig fields.Key changes:
ssrfPolicy.allowRfc2544BenchmarkRangethrough from config tofetchWithSsrFGuardinweb-fetch.ts:539ToolsWebFetchSchemamissing fields (readability,ssrfPolicy,firecrawl) that caused silent rejection with.strict()validationConfidence Score: 5/5
Last reviewed commit: 41ab60b