Skip to content

Authenticate the loopback proxy and add deny-all + strictAllowlist - #310

Merged
shawnm-anthropic merged 3 commits into
mainfrom
fix/network-deny-all-and-proxy-auth
Jun 15, 2026
Merged

shawnm-anthropic merged 3 commits into
mainfrom
fix/network-deny-all-and-proxy-auth

Conversation

@poteat

@poteat poteat commented Jun 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

TLDR: per-session token on the loopback proxy; deniedDomains "*" = deny-all; new strictAllowlist flag.

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.

deniedDomains accepts a bare "*" (deny-all). allowedDomains still rejects it as too broad.

network.strictAllowlist: true denies 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

poteat added 3 commits June 15, 2026 11:20
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
shawnm-anthropic merged commit 725eb7a into main Jun 15, 2026
8 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.

2 participants