Repository navigation
fix(server): gate the custom HTTP tool's own proxy - #956
Merged
Merged
Conversation
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
force-pushed
the
fix/customtool-proxy-validate
branch
from
December 4, 2026 00:06
750e407 to
49b9421
Compare
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.
Summary
With the target gate on, only the custom HTTP tool's URL was checked: the proxy in the tool's
proxyfield 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
coveringPindoes not accept a name-only pin on the name alone for it, andPinnedDialerDirectdials the pinned addresses. A proxy name that later answers another address is refused withTARGET_APPROVAL_PENDINGinstead of being dialled unpinned.socks5andsocks5hwithout a port are checked on 1080, the port net/http dials.ARTEX_SANDBOX=requiredand the gate-off paths are unchanged; the recording and global proxies are still exempt from this check. A tool that usesuse_recording_proxyand 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 at203.0.113.7, the pin is not name-only, the name is rebound to203.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 theinterceptand 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.