Preface¶
The built-in web_fetch in DeepSeek Harness (DSH) blocks internal networks and reserved address ranges after DNS resolution to mitigate SSRF risks. While this is a sensible default for most public scraping scenarios, if you are using a transparent proxy like Clash or mihomo locally, DNS may return a fake-IP (commonly 198.18.0.0/15). The built-in validation treats these addresses as unreachable or dangerous targets, causing requests to fail at the resolution stage.
The protection logic of the built-in web_fetch cannot be disabled or relaxed via configuration. The community plugin dsh-web-fetch-allowlist (maintained by icceey, categorized under admin-security) works alongside the built-in resolution and validation. It provides additional allowance based on a configurable CIDR whitelist only when a WEB_BLOCKED_URL is triggered. It is suitable for developers who need to continue using web_fetch in DSH while working with fake-IP proxy chains.
What is this¶
dsh-web-fetch-allowlist is a patch-type plugin for the DSH built-in web_fetch provider. It does not alter behaviors such as timeouts, size limits, redirects, proxies, NAT64, or character sets. It only intervenes when the built-in implementation throws a WEB_BLOCKED_URL due to address range policies. At that point, it checks if the resolved address falls within the user-configured CIDR; if it matches, the address is allowed, otherwise, the original error is thrown as is.
If the built-in provider does not exist, or if an DSH upgrade changes the internal structure, the plugin remains silent and does not intervene.
Core Features¶
- Configurable CIDR Whitelist:
allowCidrssupports IPv4/IPv6. If not set in the plugin configuration, it can read from the environment variableDSH_WEB_FETCH_ALLOW_CIDRS(comma-separated). - Default Coverage for Clash/mihomo fake-IP Ranges: If the fake-IP configuration hasn’t been changed, the default includes
198.18.0.0/15. Usually, no further configuration is needed after installation (see README for details). - Whitelist on Failure Only: It first runs the full resolution and validation through the built-in provider. It only attempts the whitelist check if the error is
WEB_BLOCKED_URL. The error codes and semantics when not matched remain consistent with the built-in implementation. - Alignment with Built-in Behavior: Except for whitelist allowances, all other paths are identical to the built-in implementation. It avoids replacing the entire fetch strategy with the plugin.
Installation and Activation¶
In the DSH management interface: Plugins → Add plugin, enter the repository address:
https://github.com/icceey/dsh-web-fetch-allowlist
Or use the CLI (replace <profile> with your profile name):
dsh plugin --profile <profile> add github:icceey/dsh-web-fetch-allowlist
If the manager prompts restart-required, restart DSH or re-enable the plugin as instructed before verifying web_fetch.
The plugin requires Node >=22.19 (see the engines field in the repository’s package.json).
Configuration Example¶
If using Clash/mihomo without adjusting fake-IP, the README states it is generally ready to use immediately after installation. If you need to explicitly write the configuration, add the following to the profile’s plugin section:
- id: web-fetch-allowlist
name: 'dsh-web-fetch-allowlist'
config:
allowCidrs:
- '198.18.0.0/15'
allowCidrs replaces the default value rather than appending to it; if there are multiple network segments, list them all in the array. You can also provide comma-separated CIDRs via the environment variable DSH_WEB_FETCH_ALLOW_CIDRS, which takes effect when allowCidrs is not configured.
Typical Usage and Behavior Verification¶
- Keep DSH and the proxy (Clash/mihomo) running as usual, and install and enable this plugin.
- Call the built-in
web_fetchvia the Harness to access a URL previously blocked byWEB_BLOCKED_URLdue to fake-IP. - If the resolved address falls within
allowCidrs(or equivalent environment variable configuration), the plugin allows it; otherwise, the same blocking error as the built-in system is received.
The README does not provide a standalone demo script; verification relies on actual web_fetch requests and error codes.
Use Cases and Notes¶
Suitable for: Scenarios where a transparent proxy + fake-IP is used on the local machine or a fixed environment, and web_fetch must be used within the DSH agent workflow to fetch pages; scenarios requiring additional allowance for specific internal or experimental network segments (narrowing the CIDR yourself with the understanding of SSRF risks).
Notes:
- The whitelist relaxes the network segment of the resolution result, which does not equal trusting the target URL. You should only configure segments whose purpose you clearly know (such as fake-IP pools) and avoid arbitrarily adding large public ranges or the entire RFC1918.
- The plugin runs with the permissions of the current DSH process. Before installation, please read the source code and MIT license of the GitHub repository to ensure it aligns with your security policy.
- The community directory SkillHub plugin page and GitHub are maintained by the community and have no official affiliation with DeepSeek / High-Flyer. Versions and behaviors are subject to the repository README.
Conclusion¶
dsh-web-fetch-allowlist adds configurable CIDR allowances for web_fetch without dismantling DSH’s built-in SSRF protection. It aligns with Clash/mihomo fake-IP segments by default, making it suitable for scraping debugging and daily use in proxy environments.
- Directory Page: https://www.skillhub.cn/plugins/icceey/dsh-web-fetch-allowlist
- Source Code & Docs: https://github.com/icceey/dsh-web-fetch-allowlist