Repository navigation
Authenticate the loopback proxy and add deny-all + strictAllowlist - #310
Merged
Merged
Conversation
The HTTP and SOCKS proxies listen on 127.0.0.1, so any host process could dial them and reach the filter callback. They now require a per-session token (Basic for HTTP, SOCKS5 username/password for SOCKS), generated at init and exported only into the sandbox child env via the proxy URLs. deniedDomains accepts a bare "*" (deny-all) and matchesDomainPattern honors it; allowedDomains still rejects "*" as too broad. strictAllowlist makes the allowlist deterministic enforcement: hosts not in allowedDomains are denied without consulting the ask callback.
The token wasn't passed to the Windows wrap call, so the child env's proxy URLs didn't carry it and every via-proxy test 407'd. Also update the D2 not-an-open-relay test: the proxy now has a per-session secret (matching the donor design the test note described), so a host process without it is refused at the handshake; the destination filter still applies once authenticated.
git-for-windows' credential manager intercepts the 407 challenge for the proxy URL and the URL-embedded password doesn't survive it. Set http.proxyAuthMethod=basic via GIT_CONFIG_PARAMETERS so git pre-sends the credential and never sees a 407. Also make the proxy's auth check decode-then-compare on the password instead of exact-string-matching the whole header, so case/whitespace variation in the Basic prefix is tolerated.
shawnm-anthropic
approved these changes
Jun 15, 2026
3 tasks done
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
Three related fixes from an enterprise report:
The HTTP and SOCKS proxies listen on 127.0.0.1, so any host process could dial them and reach the filter callback. They now require a per-session token (Basic auth for HTTP, SOCKS5 user/pass for SOCKS), generated at init and exported only into the sandbox child env via the proxy URLs and tool-specific vars.
deniedDomainsaccepts a bare"*"(deny-all).allowedDomainsstill rejects it as too broad.network.strictAllowlist: truedenies off-allowlist hosts without consulting the ask callback, so a policy allowlist is enforcement rather than a prompt-suppression hint.Test Plan
New tests in
update-config.test.ts: CONNECT without token → 407 / with token → 200;deniedDomains: ["*"]→ 403 for any host;strictAllowlist→ off-allowlist 403 with callback never invoked. Full suite green.Links