Skip to content

fix(browser): gate non-http(s) URLs in browser.tabs new#30

Open
Bartok9 wants to merge 1 commit into
AtomicBot-ai:mainfrom
Bartok9:sera/browser-tabs-url-approval
Open

fix(browser): gate non-http(s) URLs in browser.tabs new#30
Bartok9 wants to merge 1 commit into
AtomicBot-ai:mainfrom
Bartok9:sera/browser-tabs-url-approval

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • Gate browser.tabs action: "new" the same way as browser.navigate: non-http(s) schemes require operator approval via isSafeUrl + requireApproval.
  • Prevents file:// / javascript: / data: / etc. from opening in a secondary tab without the approval gate.

Motivation

Closes #29.

browser.navigate already blocks dangerous schemes behind the approval gate. browser.tabs with action: "new" + a url skipped that check and forwarded straight into page.goto, so a model could open local files or script URLs through a second tool path. This mirrors the navigate contract at the tool layer (no Playwright backend behaviour change).

Verification

  • npx vitest run src/tools/browser/browser-tools.test.ts32 passed
  • New coverage:
    • tabs new + https does not request approval
    • tabs new + file://ApprovalDeniedError, backend never called
    • tabs new + javascript: → same
    • tabs list never hits the URL gate
  • Did not change: Playwright spawn/attach, ARIA compression, lock cleanup

Commit

  • Conventional + DCO (Signed-off-by: Bartok9 <danielrpike9@gmail.com>)

Agent-Owner: sera · Platform: hermes · Claim-TTL: 24h

Mirror browser.navigate approval for tabs action=new so file://,
javascript:, and other non-http(s) schemes cannot open a secondary tab
without the operator gate. Closes the bypass surface verified on main.

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browser.tabs action=new bypasses non-http(s) URL approval gate

1 participant