Skip to content

Webfetch rejects reachable public sites behind Fake IP DNS; shared tools inherit the failure #979

Closed

Description

What happened?

webfetch cannot access public HTTPS sites when the system resolver returns a TUN proxy's Fake IP addresses. On this machine, GitHub resolves to 198.18.0.30 and the tool fails before opening a connection:

Network access to non-public address 198.18.0.30 for github.com is blocked

There were 33 webfetch failures with this cause in local tool records. The same public URL returns HTTP 200 through curl. An isolated call to OpenScience's original pinnedFetch using the same resolved address also returns 200. This is a tool compatibility problem: the transport works, but the address policy cannot represent the trusted local proxy's mapping.

Expected: a supported, explicit trusted-proxy path that preserves SSRF protection. This report does not request globally allowing benchmark/private addresses.

Steps to reproduce

  1. Run OpenScience 2.0.151 on macOS with a TUN proxy returning Fake IP DNS answers (observed with Shadowrocket).
  2. Confirm python3 -c 'import socket; print(socket.getaddrinfo("github.com", 443))' includes an address in 198.18.0.0/15.
  3. Ask webfetch to fetch https://github.com.
  4. Compare with curl -I https://github.com on the same machine.

Code location and related effects

  • network.ts:503 blocks this entire range; line 691 checks DNS unconditionally before transport.
  • science/connectors/http.ts:327, tool/biology/database.ts:11, tool/generate-image.ts:251, science/bionemo/download.ts:43, and session/instruction.ts:114 share this path. Original guard tests also rejected UniProt, NCBI, Crossref, OpenAlex and PubChem under this DNS configuration. These are shared-function tests, not complete end-to-end runs of every tool.
  • The connector wrapper retries the deterministic policy error four times by default (observed ~7.4 seconds). http.ts:393 does not distinguish a policy refusal from a transient transport error.
  • instruction.ts:244 silently drops remote instruction failures; bionemo/download.ts:60 replaces them with advice to retry for a fresh link. These code paths hide the actionable cause.

How did you install OpenScience?

Desktop app from the official macOS ARM64 release ZIP; also npm install -g @synsci/openscience.

OpenScience version

2.0.151 (latest npm release at reporting time).

Provider and model

Not needed for the network-layer reproduction; the original UI symptom occurred during a webfetch tool call.

Operating system

macOS 27.0, Apple Silicon. Isolated source checks used Bun 1.3.13; the packaged desktop runtime was not independently identified.

Action approval mode

Not sure. The reproduced rejection is the non-public-address check, not a domain permission denial.

Logs and screenshots

The redacted error above is the relevant tool output. No private session records or credentials are attached.

Activity

  1. aayambansal commented on Oct 18, 2026

    @aayambansal
    Member

    Implemented the explicit compatibility path in #998, now squash merged to main. The default resolver and private-address checks remain unchanged. For a TUN setup that substitutes Fake IP DNS answers, opt in before launching the new build:

    OPENSCIENCE_DNS_RESOLVER=cloudflare openscience

    This uses Cloudflare DNS-over-HTTPS over a fixed public bootstrap address with hostname-verified TLS, then applies the existing public-address checks to every answer and redirect before connecting. DNS queries are shared with Cloudflare only when this option is selected. Alternatively, exclude the required hosts from your proxy's Fake IP mapping. The error and configuration guide now explain both options, and policy refusals no longer spend a scientific connector's retry budget or repeat an unusable BioNemo signed-link retry.

    Tests cover synthetic system DNS, private/mixed answers, redirect protection, and cancellation; a live pinned DNS query also passed. I cannot reproduce your particular Shadowrocket configuration here. Please reopen with the resulting content-free diagnostic if the explicit mode still fails there; benchmark/private addresses have not been globally allowed.

    Validation passed on the supported pinned runtime, including the focused network and scientific-connector regressions, plus PR CI. These source fixes are on main; installed 2.0.151 builds need a release containing them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions