Skip to content

fix(server): gate the custom HTTP tool's own proxy - #956

Merged
BaaRai merged 1 commit into
mainfrom
fix/customtool-proxy-validate
Dec 4, 2026
Merged

BaaRai merged 1 commit into
mainfrom
fix/customtool-proxy-validate

Conversation

@BaaRai

@BaaRai BaaRai commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Summary

With the target gate on, only the custom HTTP tool's URL was checked: the proxy in the tool's proxy field was dialled without any check, so a tool whose target was approved could send its request to any host and port, loopback and private addresses included, through a proxy nobody approved. A proxy hostname also stayed name-only: its approval ignored a later address change.

Changes

  • With the gate on and the sandbox off, the tool's own proxy is a target like the URL: the call waits for an approval or is refused, the approval request shows the host and port without credentials, and the connection is checked and dialled through the gate.
  • The proxy hop is a direct connection: its approval pins the addresses it resolved, coveringPin does not accept a name-only pin on the name alone for it, and PinnedDialerDirect dials the pinned addresses. A proxy name that later answers another address is refused with TARGET_APPROVAL_PENDING instead of being dialled unpinned.
  • socks5 and socks5h without a port are checked on 1080, the port net/http dials.
  • ARTEX_SANDBOX=required and the gate-off paths are unchanged; the recording and global proxies are still exempt from this check. A tool that uses use_recording_proxy and has no own proxy is unchanged.

Tests

  • server/customtool_proxy_gate_test.go: an approved URL does not let an unapproved proxy be dialled; a saved tool with a hostname proxy is approved at 203.0.113.7, the pin is not name-only, the name is rebound to 203.0.113.9, and the call is refused without a dial or a proxy hit.
  • server/customtool_dial_test.go: the former bypass test now proves the proxy is gated and dialled at the pinned address; gate-off and required-mode tests are unchanged.
  • server/customtool_proxy_url_test.go: credentials stripped, socks5 default port, IPv6.
  • go build ./..., go vet, and the intercept and target-gate tests pass; the PostgreSQL rebinding case is RED on the previous head and GREEN here.

Behaviour change

With the gate on, the first call of a tool that has its own proxy raises an approval request for the proxy host and port, or is refused when none is granted.

With the target gate on, only the tool URL was checked and the proxy in the
tool's proxy field was dialled without a check, so an approved target could
be fetched through any host and port. Read the proxy as a target, as a proxy
named on a Bash command line is: the call waits for its approval, the
request records the proxy without credentials, and the proxy is dialled
through the pinned dialer. The recording and global proxies, required mode
and the gate-off paths are unchanged.
@BaaRai
BaaRai force-pushed the fix/customtool-proxy-validate branch from 750e407 to 49b9421 Compare December 4, 2026 00:06
@BaaRai
BaaRai merged commit df5e047 into main Dec 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant