Repository navigation
Prevent WebAuthn presentation-window leaks - #9529
austinywang wants to merge 2 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughWebAuthn authorization now uses one hidden reusable fallback window when no existing presentation window is available. The coordinator retires it after cancellation, completion, or deallocation. Tests, lint coverage, and manual instructions validate lifecycle and cleanup behavior. ChangesWebAuthn fallback lifecycle
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant WebAuthnRequest
participant BrowserWebAuthnCoordinator
participant FallbackPresentationWindow
participant ASAuthorizationController
WebAuthnRequest->>BrowserWebAuthnCoordinator: request presentation anchor
BrowserWebAuthnCoordinator->>FallbackPresentationWindow: create or reuse hidden window
BrowserWebAuthnCoordinator->>ASAuthorizationController: provide presentation context
ASAuthorizationController->>BrowserWebAuthnCoordinator: complete or cancel authorization
BrowserWebAuthnCoordinator->>FallbackPresentationWindow: order out and close window
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f086193 to
21aca0e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmuxTests/BrowserWebContentProcessTests.swift`:
- Around line 986-991: Extend the assertions around the
BrowserWebAuthnCoordinator fallback window to verify its noninteractive
contract: it is hidden, cannot become key, ignores mouse events, and is excluded
from the window menu. Use the fallback window represented by anchors or the
relevant BrowserWebAuthnCoordinator properties, and retain the existing reuse,
removal, and single-window assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 25743c6b-be1d-4cbe-9e71-f7bfff320032
📒 Files selected for processing (1)
cmuxTests/BrowserWebContentProcessTests.swift
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmuxTests/BrowserWebContentProcessTests.swift`:
- Around line 962-971: Extend the presentation-anchor tests with a separate case
that creates a test-owned visible key window before calling
presentationAnchor(for:). Assert the coordinator preserves that window’s
visibility and key status, while keeping the existing hidden-window fallback
test and its cleanup unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a6c336d3-94b9-4cdd-b49e-f4f044f8d1f5
📒 Files selected for processing (1)
cmuxTests/BrowserWebContentProcessTests.swift
21aca0e to
9a114cc
Compare
152785f to
4c55145
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmuxTests/BrowserWebContentProcessTests.swift`:
- Around line 978-995: Add a separate test around
BrowserWebAuthnCoordinator.presentationAnchor(for:) that creates and owns a
visible key window before requesting the anchor. Assert the returned anchor is
that existing window and remains visible and key, while keeping the current test
focused on the fallback behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 67d1e13f-b882-4e18-be58-7e7c86a4f34f
📒 Files selected for processing (3)
Sources/Panels/BrowserWebAuthnSupport.swiftcmuxTests/BrowserWebContentProcessTests.swiftverification.html
976968f to
83deac7
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
d080a0b to
4da075d
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
4da075d to
abd7674
Compare
abd7674 to
c769c28
Compare
…ey test RP plans/cmux-next/passkeys.md proposes Chrome-parity passkeys for CEF and WebKit panes. Its "Known bugs: do not repeat" table lists every passkey bug in the old app and repo history (K1-K18) with symptom, root cause, fix status and the regression test each engine needs. New findings: cmux next lost the whole WebKit passkey bridge with the legacy deletion on 2026-09-29 (#15659), so WebKit panes are back to "partial passkey support" and the #9060/#15525 fixes are gone; the RC channel ships without the passkey entitlement (verified on the installed 0.65.0-rc); three fixes on main never merged (#6766 hybrid routing, #8630 private-selector crash, #9529 leaked presentation windows); the bridge was silently dropped for ten weeks by cb1a6de; the bridge ignores AbortSignal; Chromium refuses WebAuthn in a tab that is not VISIBLE (cmux-browser #95), which applies to our CEF occlusion and hibernation. tests/passkeys: a local relying party (index.html, frame.html on frame.localhost for cross-origin iframes, scenarios.js) and run.mjs, which runs 17 scenarios in Chromium with a DevTools virtual authenticator. Stock Chrome for Testing 153.0.8010.12 passes 17/17 (16 judged, 1 record-only); the same runner targets a cmux CEF instance with --cdp, and --serve serves the page for manual runs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Summary
Fixes #7503
Testing
58faefe8fa: remotecmux-unitrunsym7503-red-valid-aa900688704dwith-only-testing:cmuxTests/BrowserWebContentProcessTests; the regression recorded 3 distinct anchors and 3 new windows instead of 1 (exit 65).c769c288dc: remotecmux-unitrunsym7503-review6b-e4804120e40awith-only-testing:cmuxTests/BrowserWebContentProcessTests/webAuthnPresentationAnchorDoesNotAccumulateFallbackWindows(); 1 test passed in 0.056 seconds.bash tests/test_ci_auxiliary_window_close_shortcuts.shpython3 scripts/lint_auxiliary_window_close_shortcuts.py./scripts/check-pbxproj.sh./scripts/lint-pbxproj-test-wiring.sh./scripts/reload-cloud.sh --tag sym7503: cloud build 30966165608 succeeded onblacksmith-6vcpu-macos-26and downloaded the tagged app./tmp/cmux-debug-sym7503.sock: 11 real registration attempts onhttps://webauthn.io/all completed with the expected site-level failure and no browser errors. The app-owned WindowServer count stayed at the exact 10-window quiet baseline before and after the requests, with no level-20 window. A fresh browser reopen/request/close cycle also returned to the same baseline. The tagged app was then terminated by its validated socket-owner PID and the socket was removed.Needs human verification
The deterministic lifecycle regression and immediate tagged-app stress loop are verified. The reported hours-or-days scenario across sustained multi-workspace churn, sleep/wake, and external-display reconnects cannot be compressed into this run. Follow verification.html for that single remaining claim; the fix is disproven if quiet untitled-window counts grow, a level-20 rectangle survives, or an invisible cmux window intercepts clicks.