fix(browser): block private-page interactions after eval navigation (salvage #55949) - #56173
Merged
Merged
Conversation
…x blank lines Review follow-up on the private-page action guard: - Add test_guard_inactive_does_not_block_or_probe: when the SSRF guard is inactive (local backend / allow_private_urls), click/type/press must proceed WITHOUT probing the page URL. This is the branch most likely to silently regress if the guard condition is inverted; a mutation check (flipping the condition) confirms the test fails as designed. - Add test_camofox_short_circuits_before_guard: camofox mode returns from the dedicated camofox_* path before the guard runs; guards never consulted. - Fix PEP8: 3 -> 2 blank lines before _blocked_private_page_action.
19 tasks
19 tasks
kshitijk4poor
pushed a commit
to kshitijk4poor/hermes-agent
that referenced
this pull request
Jul 2, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in NousResearch#56173, NousResearch#56526, NousResearch#56664. Salvage of NousResearch#56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
kshitijk4poor
pushed a commit
that referenced
this pull request
Jul 2, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in #56173, #56526, #56664. Salvage of #56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
This was referenced Jul 2, 2026
Jasper6439
pushed a commit
to Jasper6439/hermes-agent
that referenced
this pull request
Jul 5, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in NousResearch#56173, NousResearch#56526, NousResearch#56664. Salvage of NousResearch#56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in NousResearch#56173, NousResearch#56526, NousResearch#56664. Salvage of NousResearch#56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in NousResearch#56173, NousResearch#56526, NousResearch#56664. Salvage of NousResearch#56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in NousResearch#56173, NousResearch#56526, NousResearch#56664. Salvage of NousResearch#56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
Extends the browser private-network eval guard to the Camofox backend. On main, _browser_eval() returned early in Camofox mode before running the shared private-URL literal pre-scan and before re-checking the page URL after eval, leaving Camofox as a sibling backend that could execute browser_console(expression=...) against private/internal targets. - move the eval private-URL literal pre-scan before the Camofox early return - add a Camofox current-page private-URL probe via the evaluate endpoint - withhold Camofox eval results when the page is now private/internal Follow-up to browser private-network hardening in NousResearch#56173, NousResearch#56526, NousResearch#56664. Salvage of NousResearch#56764 by @rayjun (rayoo), cherry-picked to preserve authorship.
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
Salvage of #55949 (rebased onto current
main+ review follow-up). Blocks state-changing browser interactions (browser_click,browser_type,browser_press) when a cloud-browser page has landed on a private/internal URL after JavaScript-driven navigation.Original PR #55949 by @necoweb3 was 67 commits behind
main. Its commit is cherry-picked here verbatim (authorship preserved) and rebased onto currentmain, plus one review follow-up commit under my identity.Why
Recent browser SSRF hardening (#54132, #54435, #54477) covers content-returning paths —
browser_snapshot,browser_vision,browser_console,browser_get_images— which re-check the current page URL after eval-driven navigation and refuse to return private-network content.The state-changing interaction sinks had no sibling guard. If a page was navigated to a private/internal URL through an eval-driven path (e.g.
location.href = 'http://169.254.169.254/...'viabrowser_console),browser_click,browser_type, andbrowser_presswould still send input to that page. In cloud-browser mode that crosses the same private-network boundary — as a side-effect primitive rather than a read primitive. Reproduced on currentmain: click/type/press all reach_run_browser_commandon a synthetic private page, andbrowser_typeechoes the typed sentinel back.Changes
_blocked_private_page_actionintools/browser_tool.py.browser_click,browser_type, andbrowser_presswhen the current cloud-browser page is private/internal._eval_ssrf_guard_active()and_current_page_private_url()checks (identical fail-open-on-probe-error semantics as the snapshot/vision/eval guards).back,scroll) unchanged — they send no attacker-controlled input to the page.Review follow-up (this salvage)
test_guard_inactive_does_not_block_or_probe— the guard-inactive branch (local backend /allow_private_urls) must proceed WITHOUT probing the page URL. This was the untested branch most likely to silently regress if the condition is inverted; a mutation check (flippingif not ...→if ...) confirms the new test fails as designed.test_camofox_short_circuits_before_guard— asserts the camofox early-return precedes the guard so its helpers are never consulted in local/Camofox mode.Tests
Full browser suite: 458 passed, 3 failed (pre-existing
test_browser_secret_exfil.py::TestWebExtractSecretExfil, unrelated — verified identical onHEAD~1), 30 skipped. This change introduces zero new failures.Supersedes #55949. Credit to @necoweb3 for the original fix.