mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
The daemon dispatched inbound `session.window_closed` and `session.user_interrupt` events using only the payload — the sending browser's identity was never checked against the session's owner. Any connected extension could therefore emit window_closed with another browser's session_id to tear down its session (forgetting it, dropping its tool queue + interrupt marker), or emit user_interrupt to cancel every inflight tool of another browser's session and arm its interrupt marker. This is a cross-tenant integrity/DoS hole that is exploitable even between two legitimate extensions, independent of the (separately tracked) WS Origin allow-list gap. Thread the sender's BrowserId (already in scope as `client.id` in handle_inbound_text) into both handlers and ignore the event when the named session is live and owned by a different browser. A session that is already gone is left to the existing no-op forget path. Adds four ownership tests (owner honoured / non-owner ignored for each event); updated two existing tests for the new signature. Full bsk suite green (165 lib + integration), no new clippy warnings. Co-Authored-By: Claude <noreply@anthropic.com>