Skip to content

fix(browser): extend private-network guard to browser_console - #54477

Closed
necoweb3 wants to merge 1 commit into
NousResearch:mainfrom
necoweb3:fix/browser-console-ssrf-guard
Closed

fix(browser): extend private-network guard to browser_console#54477
necoweb3 wants to merge 1 commit into
NousResearch:mainfrom
necoweb3:fix/browser-console-ssrf-guard

Conversation

@necoweb3

Copy link
Copy Markdown
Contributor

Summary

This extends the browser private-network SSRF guard to browser_console() when it is used in console-output mode.

Why

Recent SSRF fixes sealed browser_snapshot, browser_vision, _browser_eval, and browser_get_images against eval-navigated private pages. However, browser_console() has two modes:

  • browser_console(expression=...) evaluates JavaScript and already routes through _browser_eval.
  • browser_console() without expression fetches console logs and uncaught exceptions directly.

The second path did not re-check the current page URL before returning console/error output. After an eval-driven navigation to a private/internal URL, this could expose console messages or exception details from the internal page.

Changes

  • Add the same _eval_ssrf_guard_active() + _current_page_private_url() check to browser_console() console-output mode.
  • Return a blocked error payload when the current page is private/internal.
  • Add regression coverage for private-page blocking, public-page allow, local-backend bypass, and allow_private_urls bypass.

Tests

python -m pytest tests/tools/test_browser_console_ssrf.py -q --timeout-method=thread
5 passed

python -m pytest tests/tools/test_browser_get_images_ssrf.py tests/tools/test_browser_eval_ssrf.py tests/tools/test_browser_snapshot_ssrf.py -q --timeout-method=thread
34 passed

@alt-glitch alt-glitch added type/security Security vulnerability or hardening tool/browser Browser automation (CDP, Playwright) P1 High — major feature broken, no workaround sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data labels Jun 28, 2026
@egilewski

Copy link
Copy Markdown
Contributor

looks mergeable

I found no source-level blocker in the browser private-network guard change. The patch closes the browser_console console-output gap by checking the current page URL before returning console messages or uncaught exceptions, and current-main reproduction, PR-head and patch-replay probes, focused browser SSRF tests, sibling guard inspection, merge-tree/whitespace checks, the required GitHub aggregate check, and reviewer-tooling output left no source-backed blocker.

The sensitive boundary is untrusted page console output and exception details after browser eval navigation to a private/internal URL; browser_console() now applies the same non-local private-network guard before reading those buffers, while public-page, local-sidecar, and configured private-URL opt-out behavior remain preserved.

Signed: GPT-5.5-xhigh in Codex

@teknium1

teknium1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #56373. Your commit was cherry-picked onto current main with your authorship preserved in git log (a4af257). Thanks for sealing the last read path the SSRF sweep missed!

@teknium1 teknium1 closed this Jul 1, 2026
hashbender added a commit to hashbender/hermes-agent that referenced this pull request Jul 1, 2026
…NousResearch#54477) (#321)

Co-authored-by: qbit-mirror-bot <qbit-mirror-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High — major feature broken, no workaround sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data tool/browser Browser automation (CDP, Playwright) type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants