[Bug]: web_fetch rejects public websites behind Fake-IP/TUN proxies (locally fixed)
This was generated by AI during triage.
Describe the bug
web_fetch rejects a public website when a local TUN proxy returns a synthetic Fake-IP address from 198.18.0.0/15. The host safety check treats that address as a private/restricted destination and stops before downloading the page.
I have already fixed this specific false rejection locally and installed the patch in my desktop app. An end-to-end conversation now successfully fetches the page with one web_fetch call. This report documents the upstream issue; I have not submitted a PR yet.
Steps to reproduce
- Run DeepTutor with the local
web_fetchbackend on Windows, using a TUN proxy with Fake-IP DNS enabled. - Ask the assistant to read
https://caomaolufei.github.io/AIInfraGuide/blog/update-log/. - In my environment, system DNS resolves the hostname to
198.18.3.152. web_fetchrejects the hostname before making the page request:
Refusing to fetch private/loopback host: caomaolufei.github.io.
The same public page can be downloaded successfully outside this validation path. I originally noticed the difference between DeepTutor and Qoder's own webpage tool. The rejection is in DeepTutor's shared fetch implementation, not in Qoder model inference.
Expected Behavior
Public websites should remain accessible in a Fake-IP/TUN environment, while genuine private, loopback and link-local destinations remain blocked. A synthetic proxy address should not, by itself, be treated as proof that the requested website is internal.
Related Module
API/Backend — deeptutor/tools/web_fetch.py
Configuration Used
- Open DeepTutor desktop v1.7.3, based on commit
4c1e000d8563c5ac3b231baaaf149dc4dc4d2406 - Windows; bundled Python 3.12.13
web_fetch_backend: local- Local proxy using Fake-IP DNS
- Reproduced in a conversation using my local Qoder provider integration; the fetch function also reproduces the rejection independently of an LLM
Root cause and local fix
_is_disallowed_host() checks system DNS results through _is_disallowed_ip(). The synthetic 198.18.x.x result is rejected, although the proxy would route the original hostname to the public website.
My local patch handles this narrowly:
- Only hostnames whose local DNS answers are all inside
198.18.0.0/15enter the compatibility path. Literal Fake-IP URLs are still rejected. - Query public A records over HTTPS DNS (AliDNS in my local patch), and require a nonempty set of public addresses before allowing the fetch.
- Keep the original hostname for the actual HTTP request and normal TLS verification. This is an additional DNS validation step, not IP pinning.
- Keep private-address checks for ordinary DNS answers and each redirect; reject mixed Fake-IP/private answers.
- Include the failing operation and exception type in network errors, so DNS failures and page-download failures can be distinguished.
The upstream resolver choice and proxy-handling approach can follow the maintainers' preferred design. I am not proposing to disable the private-address checks or TLS verification.
Validation and scope
- 104 tests passed across the fetch tool and fetch-provider suites, including new Fake-IP, private-address, mixed-answer and redirect cases.
- The installed desktop backend successfully returned approximately 42,000 characters from the example page.
- A real Qoder conversation completed with one
web_fetchcall and correctly identified the page title and latest update entry,2026-11-07. - Intermittent connection resets/TLS EOF errors also occurred during network testing. Those are separate from the deterministic Fake-IP rejection and are not claimed to be fixed by this patch.
我已在本地修复并更新到桌面版,验证了该网页可通过 web_fetch 成功读取;目前尚未提交 PR。本次修复针对 Fake-IP 导致的公网网页误拦截,不包含代理链路偶发的 TLS/EOF 问题。