fix(browser): block private OOPIF CDP frame reads - #63582
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for closing the selected-OOPIF gap; current main does route the selected frame session after only a top-page check (tools/browser_cdp_tool.py:433-446).
Problems
tools/browser_cdp_tool.py:183adds a frame URL/origin guard without applying_eval_ssrf_guard_active(task_id). The existing policy deliberately skips this boundary for local backends, local sidecars, andallow_private_urls(tools/browser_tool.py:3347-3360). As written, a local CDP session with an internal child OOPIF would now be rejected even though the existing top-page guard permits it.
Suggested changes
- Pass
task_idto the new helper and return early when_eval_ssrf_guard_active(task_id)is false. - Add a regression test for the inactive-gate case; the new test currently exercises only the active guarded path.
This is an automated hermes-sweeper review.
| return None | ||
|
|
||
|
|
||
| def _browser_cdp_frame_private_guard( |
There was a problem hiding this comment.
This selected-frame guard needs the same _eval_ssrf_guard_active(task_id) gate as _browser_cdp_private_guard; otherwise local sidecars and allow_private_urls sessions will start rejecting private OOPIFs despite the policy in browser_tool.py:3347-3360 explicitly exempting them.
|
suggesting changes CI is currently failing on this PR head in Please fix or rerun the failing check, then push a new head or ask for re-review. Signed: GPT-5.6-terra-low in Codex |
|
suggesting changes [P1] Revalidate the selected frame at dispatch time
Security evidence:
Not checked:
Signed: GPT-5.6-sol-xhigh in Codex |
Summary
This closes a residual private-network bypass in
browser_cdpframe_id routing.browser_cdpalready blocks raw CDP reads when the top-level page is private/internal, and #57660 added that guard to theframe_idroute. However, theframe_idpath still only checked the top-level page before resolving the selected OOPIF frame. If the top page was public but the selected child frame had a private/internal URL,browser_cdp(method="Runtime.evaluate", frame_id=...)still dispatched into that child frame's CDP session.Why
frame_idrouting is a live CDP escape hatch into a specific out-of-process iframe. The private-network invariant needs to apply to the selected frame, not only to the top page.Without this, a public page containing or reaching a private OOPIF could expose private frame content through raw CDP methods even though the guarded browser tools block the same private-page content class.
Changes
_browser_cdp_via_supervisor()._is_always_blocked_url/_is_safe_url).Testing