browse can keep untrusted pages off local and private network addresses (#4812) (#4888)

Adds an opt-in `browse --public-only` mode (or `BROWSE_PUBLIC_ONLY=1`):
every connection the browser makes goes through a guard that refuses
loopback, private, link-local, cloud-metadata and this machine's own
network addresses.

Why: an agent reading an untrusted page should not let that page reach
services on your machine or network (#4812). Default mode is unchanged.

Nothing to do unless you want the mode; see BROWSER.md "Public-only
mode".

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1b/red-team#1 reader=red-team
Review-Finding: p1b/red-team#2 reader=red-team
Review-Finding: p1v/outside-voice#1 reader=outside-voice
Review-Finding: p1v/outside-voice#2 reader=outside-voice
Review-Finding: p1v/outside-voice#3 reader=outside-voice
Review-Finding: p1v/outside-voice#4 reader=outside-voice
Review-Finding: p1v/adversarial-native#1 reader=adversarial-native
Review-Finding: p1v/adversarial-native#2 reader=adversarial-native
Review-Finding: p1v/adversarial-native#3 reader=adversarial-native
Review-Finding: p1v/adversarial-native#5 reader=adversarial-native
Review-Finding: p2/specialist-batched#1 reader=specialist-batched
Review-Finding: p2/red-team#1 reader=red-team
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-28 23:48:49 +00:00
1 parent 4a40464ea7
commit fb4474ec6c
46 files changed
+1396 -78

No files matched your search

+4
View File
@@ -517,6 +517,10 @@ export const KNOWN_WINDOWS_INCOMPATIBLE: Array<{ file: string; reason: string }>
file: 'test/review-pass-voice-failures.test.ts',
reason: 'split from test/review-pass.test.ts, which Windows never ran (its POSIX mode-bit check): runs bin/gstack-review-dispatch (a shebang) and bash git fixtures through test/helpers/review-pass-harness.ts',
},
{
file: 'browse/test/address-guard.test.ts',
reason: 'Bun crashes on windows-latest (bun.report, KERNEL32) while the public-only guard relays its SOCKS5 test connections (PR #4888 windows-scoped-shard, run 46198225599); public-only mode targets Linux and macOS like its e2e file, which skips Windows',
},
];
// Force-include overrides: files a WINDOWS_FRAGILE_PATTERNS regex excludes for
+1
View File
@@ -107,6 +107,7 @@ elif command -v perl >/dev/null; then perl -e 'alarm(shift);exec(@ARGV)' 30 "$@"
_A=aside; command -v aside >/dev/null || _A=$(command -v ~/.local/bin/aside)
if [ "\${GSTACK_SKIP_ASIDE:-}" = "1" ] || [ -z "$_A" ]; then
echo "NEEDS_ASIDE: \${GSTACK_PLATFORM:-$(uname)}"
elif case \${BROWSE_PUBLIC_ONLY-} in ''|0|false|off) false;; esac; then echo "ASIDE_SKIPPED: BROWSE_PUBLIC_ONLY"
else
_rc=0; _o=$(_gs_d "$_A" repl 'console.log("ASIDE_READY " + pwd)' 2>&1) || _rc=$?
case "$_rc" in