codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

Menu bar: Cursor Keychain reader tries a second account after a Deny

Open iamtoruk opened this issue 3 weeks ago • 1 comments

Found during the review of #1926.

mac/Sources/CodeBurnMenubar/Data/CursorSafeStorage.swift reads the Safe Storage password from the Keychain by trying the accounts Cursor Key and then Cursor (accounts at line 12, readPassword() at lines 106-108). Any failure on the first account falls through to the second, a user Deny included. So a user who clicks Deny on the Cursor Key prompt can get a second prompt for Cursor straight after.

The Keychain consent policy (#1802) says stop at Deny. The reader should distinguish "item not found" (try the next account) from "access denied or cancelled" (stop, report locked), and the shared unlock from #1926 should record the Deny so Cursor and Grok Bot both stay quiet until the next user action.

Affected: macOS menu bar, Cursor and Grok Bot quota, only on Keychain prompt Deny.

iamtoruk avatar Nov 10 '26 00:11 iamtoruk

The password lookup returned nil for both a missing item and a denied request. The account loop treated every nil as a reason to try the legacy account.

The reader now tries the legacy account only when the first lookup reports errSecItemNotFound or succeeds with an empty password after trimming whitespace. A denial, cancellation, or other lookup failure ends the read.

https://github.com/getagentseal/codeburn/pull/1937

mvanhorn avatar Nov 18 '26 19:11 mvanhorn