Repository navigation
fix(browser): block interaction-triggered navigation SSRF - #104254
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 219f99e6ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw err; | ||
| }); | ||
| try { | ||
| return await awaitActionWithAbort(guardedAction, abortPromise, onActionResolvedAfterAbort); |
There was a problem hiding this comment.
Return policy denials without waiting for act timeout
When a guarded long-running action such as act:wait observes a policy-denied document request, onPolicyDenied only stores observedPolicyError; this await still races only the wrapped action and external abort. If the denied navigation is fulfilled with the synthetic 204 to preserve the source page, page.waitForURL/waitForLoadState can keep waiting until its per-call or default action timeout before the stored SSRF error is surfaced, so blocked navigations during waits can hang for ~60s instead of returning the policy failure promptly.
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. Reviewed July 11, 2026, 6:20 AM ET / 10:20 UTC. Summary PR surface: Source +441, Tests +1834, Docs +2. Total +2277 across 20 files. Reproducibility: yes. The linked issue defines a concrete managed-Chrome interaction path, and the PR supplies live action-linked proof with zero contacts to a controlled denied listener. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the unified page-scoped interaction guard with its explicit bounded guarantee, and track complete connect-time enforcement separately as a lifecycle-owned policy proxy or owner-side egress-isolation design. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue defines a concrete managed-Chrome interaction path, and the PR supplies live action-linked proof with zero contacts to a controlled denied listener. Is this the best way to solve the issue? Yes. A handler-specific page request guard shared by every navigation-capable interaction is the narrowest maintainable fix for this request-stage gap; complete browser egress isolation is correctly separated. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8d96790b4410. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +441, Tests +1834, Docs +2. Total +2277 across 20 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
|
Validation update for exact head
Scope remains intentionally bounded: request-stage policy interception prevents denied HTTP request bytes for these page-scoped Playwright actions. Fresh-launch Chrome network-prediction suppression is defense in depth. This does not claim complete enforcement for popup first requests, redirect hops, service workers or background traffic, DNS pinning, reused extension sessions, or other browser backends; complete connect-time enforcement still requires a policy-enforcing egress proxy. |
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
d09a873 to
569055c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a34b1f67b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| run: async ({ profileCtx, cdpUrl, tab, resolveTabUrl }) => { | ||
| const evaluateEnabled = ctx.state().resolved.evaluateEnabled; | ||
| const ssrfPolicy = ctx.state().resolved.ssrfPolicy; | ||
| const navigationPolicy = browserNavigationPolicyForProfile(ctx, profileCtx); |
There was a problem hiding this comment.
Forward proxy policy to upload hook clicks
When a managed profile is launched with explicit Chrome proxy args, this new browserNavigationPolicyForProfile wiring only covers /act; the file-chooser hook still calls pw.clickViaPlaywright with only ssrfPolicy in extensions/browser/src/browser/routes/agent.act.hooks.ts:113-118. In that hook's ref upload flow, clicking the upload control can trigger the same page navigation while browserProxyMode is missing, so assertBrowserNavigationAllowed does not fail closed for proxy-routed browser traffic before the request. Please pass the same resolved navigation policy through the hook-triggered click/upload path.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
…04254) * fix(browser): guard interaction navigation requests * fix(browser): preserve pages on blocked navigation * fix(browser): enforce interaction navigation policy * test(browser): type navigation guard fixtures * fix(browser): execute guarded wait predicates * style(browser): satisfy interaction lint * fix(browser): guard hover drag and scroll navigation * fix(browser): type policy check outcomes * test(browser): type navigation guard mocks * fix(browser): preserve proxy policy for guarded interactions * fix(browser): carry navigation policy through actions * fix(browser): retain policy for existing-session guards * fix(browser): guard existing-session waits * test(browser): avoid shadowed guard pages * fix(browser): expose scroll action to agents * fix(browser): disable speculative managed preconnects * docs(browser): bound managed preconnect hardening * fix(browser): keep wait behavior outside interaction guards * chore(browser): leave release notes to release automation * fix(browser): guard all interaction navigations
Closes #103783
What Problem This Solves
Browser interactions could trigger page-controlled navigation after the route's initial URL check. The first repair covered hover, drag, and
scrollIntoView, but review found the same request-stage gap in click, coordinate click, select, press, type/submit, fill, form fill, and evaluate. A denied destination could therefore be attempted before the residual final-URL check, and multi-step actions could continue after cancellation.Why This Change Was Made
The managed Playwright path now has one canonical, page-scoped interaction transaction for every navigation-capable action. It carries the complete browser policy, intercepts policy-denied document requests before HTTP request bytes are sent, preserves the source document with a synthetic 204, stops canceled multi-step actions before their next side effect, drains in-flight policy work, and retains final-URL reconciliation and quarantine.
Per-field form filling uses the same transaction and stops at the first policy denial. The route remains installed through the action and the bounded 250 ms post-action grace window, then removes only its own handler. Allowed actions, dialogs, downloads, and existing response shapes remain functional.
Generic waits remain outside this transaction because Playwright does not provide safe per-wait cancellation; retaining a stale route or tearing down the shared connection would cross later sibling-tab and agent work. Existing-session, extension, remote-CDP, redirect-hop, popup-first-request, Service Worker, background/subresource, and complete browser-egress guarantees remain explicitly out of scope for this bounded fix.
Fresh managed Chrome launches also best-effort disable network prediction as defense in depth. That preference is not the enforcement boundary and does not claim zero DNS, TCP, TLS, or QUIC contact.
User Impact
Allowed browser interactions keep working. If page code tries to navigate to a policy-denied destination during a guarded action, the agent receives the explicit browser navigation-policy error, the source tab remains usable, later action side effects do not run, and unrelated tabs are not intercepted.
Evidence
a34b1f67b845347674009e223a0ff97b53da90b6.tbx_01kx88zzhytas72a8s5tkh6v8b(pearl-crayfish): six focused browser files, 97 tests passed.corepack pnpm check:changedpassed every selected lane in 8m35s.patch is correct, confidence 0.91).29148972157: all relevant jobs completed successfully with no failed or pending job.gpt-5.4proof on the exact head:scrollIntoView;browser navigation blocked by policyerror;about:blank, the same Chrome process and Gateway remained healthy, and no compensating/retry call occurred;