Skip to content

fix(browser): re-check interaction-driven navigations#63226

Merged
drobison00 merged 11 commits into
openclaw:mainfrom
eleqtrizit:fix/browser-interaction-guard
Apr 8, 2026
Merged

fix(browser): re-check interaction-driven navigations#63226
drobison00 merged 11 commits into
openclaw:mainfrom
eleqtrizit:fix/browser-interaction-guard

Conversation

@eleqtrizit

Copy link
Copy Markdown
Contributor

Summary

  • re-check browser tab safety after navigation-capable interaction actions
  • carry the resolved browser SSRF policy through click, evaluate, and batch interaction flows

Changes

  • run assertPageNavigationCompletedSafely(...) after Playwright click and evaluate calls so interaction-driven main-frame navigations are quarantined when they land on blocked URLs
  • thread ssrfPolicy through act route handling, hook-triggered clicks, and batched browser actions so interaction paths use the same policy as guarded navigation paths
  • add regression coverage for click, evaluate, and batch interaction flows, and update the batch test mock to match the guarded session contract

Validation

  • Ran corepack pnpm test extensions/browser/src/browser/pw-tools-core.interactions.navigation-guard.test.ts extensions/browser/src/browser/pw-tools-core.interactions.evaluate.abort.test.ts extensions/browser/src/browser/pw-tools-core.interactions.batch.test.ts extensions/browser/src/browser/pw-tools-core.clamps-timeoutms-scrollintoview.test.ts
  • Ran corepack pnpm tsgo and observed unrelated pre-existing repo-wide type errors outside the touched browser files
  • Attempted local agentic review with claude -p "/review", but the tool requested an existing PR context/number before it would proceed

Notes

  • An earlier closed branch explored the same follow-up action-gating direction; this PR reapplies the scoped interaction-path portion against current main
  • Residual gap: repo-wide tsgo is currently red on unrelated files, so validation here is scoped to the touched browser interaction surface

@greptile-apps

greptile-apps Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the browser SSRF policy guard to cover interaction-driven navigations: clicks, evaluate calls, and batch sequences. It introduces assertInteractionNavigationCompletedSafely which tracks framenavigated events during the action and checks the URL after, and scheduleDelayedInteractionNavigationGuard for late-firing navigations. ssrfPolicy is now correctly threaded from the route handlers through clickViaPlaywright, evaluateViaPlaywright, batchViaPlaywright, and the file-chooser hook click.

Confidence Score: 5/5

Safe to merge — the navigation guard logic is sound, ssrfPolicy threading is complete, and regression tests cover the key paths.

All remaining observations are cosmetic P2 (minor style inconsistency in how ssrfPolicy is read inside agent.act.ts). No correctness, security, or data-integrity issues found.

No files require special attention.

Vulnerabilities

This PR is a security improvement: it closes an SSRF bypass where a click or evaluate call could trigger a main-frame navigation to a blocked URL without the policy check running. The delayed-navigation guard (scheduleDelayedInteractionNavigationGuard) is intentionally fire-and-forget (response already sent), which is a documented tradeoff for the non-blocking path. No new security regressions identified.

Reviews (2): Last reviewed commit: "fix(browser): tighten interaction naviga..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 188313d006

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/browser/src/browser/pw-tools-core.interactions.ts
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 188313d006

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/browser/src/browser/pw-tools-core.interactions.ts Outdated
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@drobison00
drobison00 force-pushed the fix/browser-interaction-guard branch from 188313d to cc9edf7 Compare April 8, 2026 19:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0a668cf06

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/browser/src/browser/pw-tools-core.interactions.ts
@drobison00

Copy link
Copy Markdown
Contributor

@greptile review
@codex review

@drobison00
drobison00 merged commit 5f5b3d7 into openclaw:main Apr 8, 2026
9 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 995a729937

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +306 to +307
if (actionError) {
throw actionError;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Re-throw falsy interaction errors

assertInteractionNavigationCompletedSafely records failures in actionError, but later branches on truthiness (if (actionError)), so a rejected action with a falsy reason (for example Promise.reject() / throw undefined from evaluate) is treated as success and returned as undefined. This is a behavior regression from the previous direct await path and can silently mark failed act:evaluate calls as successful, which breaks caller error handling and can let later steps run on invalid assumptions.

Useful? React with 👍 / 👎.

mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Apr 8, 2026
* main: (522 commits)
  fix(browser): re-check interaction-driven navigations (openclaw#63226)
  test: reuse verbose directive reply imports
  test: reuse exec directive reply imports
  fix(browser): harden browser control override loading (openclaw#62663)
  Matrix: report startup failures as errors
  auth: persist explicit profile upserts directly
  test(doctor): mock memory-core runtime seam
  auth: avoid external cli sync on profile upsert
  feat: parallelize character eval runs
  fix: load QA live provider overrides
  build: stage nostr runtime dependencies
  fix(dotenv): block workspace runtime env vars (openclaw#62660)
  build: narrow plugin SDK declaration build
  test: harden Parallels macOS smoke fallback
  fix(memory): accept embedded dreaming heartbeat tokens
  test: harden provider mock isolation
  docs(config): tighten wording in reference
  test: reuse followup runner imports
  test: reuse image generate tool imports
  Align remote node exec event system messages with untrusted handling (openclaw#62659)
  ...
eleqtrizit added a commit that referenced this pull request Apr 8, 2026
* fix(browser): guard interaction-driven navigations

* fix(browser): avoid rechecking unchanged interaction urls

* fix(browser): guard delayed interaction navigations

* fix(browser): guard interaction-driven navigations for full action duration

* fix(browser): avoid waiting on interaction grace timer

* fix(browser): ignore same-document hash-only URL changes in navigation guard

* fix(browser): dedupe interaction nav guards

* fix(browser): guard same-URL reloads in interaction navigation listeners

* docs(changelog): add interaction navigation guard entry

* fix(browser): drop duplicate ssrfPolicy props

* fix(browser): tighten interaction navigation guards

---------

Co-authored-by: Devin Robison <[email protected]>
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* fix(browser): guard interaction-driven navigations

* fix(browser): avoid rechecking unchanged interaction urls

* fix(browser): guard delayed interaction navigations

* fix(browser): guard interaction-driven navigations for full action duration

* fix(browser): avoid waiting on interaction grace timer

* fix(browser): ignore same-document hash-only URL changes in navigation guard

* fix(browser): dedupe interaction nav guards

* fix(browser): guard same-URL reloads in interaction navigation listeners

* docs(changelog): add interaction navigation guard entry

* fix(browser): drop duplicate ssrfPolicy props

* fix(browser): tighten interaction navigation guards

---------

Co-authored-by: Devin Robison <[email protected]>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(browser): guard interaction-driven navigations

* fix(browser): avoid rechecking unchanged interaction urls

* fix(browser): guard delayed interaction navigations

* fix(browser): guard interaction-driven navigations for full action duration

* fix(browser): avoid waiting on interaction grace timer

* fix(browser): ignore same-document hash-only URL changes in navigation guard

* fix(browser): dedupe interaction nav guards

* fix(browser): guard same-URL reloads in interaction navigation listeners

* docs(changelog): add interaction navigation guard entry

* fix(browser): drop duplicate ssrfPolicy props

* fix(browser): tighten interaction navigation guards

---------

Co-authored-by: Devin Robison <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix(browser): guard interaction-driven navigations

* fix(browser): avoid rechecking unchanged interaction urls

* fix(browser): guard delayed interaction navigations

* fix(browser): guard interaction-driven navigations for full action duration

* fix(browser): avoid waiting on interaction grace timer

* fix(browser): ignore same-document hash-only URL changes in navigation guard

* fix(browser): dedupe interaction nav guards

* fix(browser): guard same-URL reloads in interaction navigation listeners

* docs(changelog): add interaction navigation guard entry

* fix(browser): drop duplicate ssrfPolicy props

* fix(browser): tighten interaction navigation guards

---------

Co-authored-by: Devin Robison <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(browser): guard interaction-driven navigations

* fix(browser): avoid rechecking unchanged interaction urls

* fix(browser): guard delayed interaction navigations

* fix(browser): guard interaction-driven navigations for full action duration

* fix(browser): avoid waiting on interaction grace timer

* fix(browser): ignore same-document hash-only URL changes in navigation guard

* fix(browser): dedupe interaction nav guards

* fix(browser): guard same-URL reloads in interaction navigation listeners

* docs(changelog): add interaction navigation guard entry

* fix(browser): drop duplicate ssrfPolicy props

* fix(browser): tighten interaction navigation guards

---------

Co-authored-by: Devin Robison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants