Repository navigation
fix(vault): require user presence instead of the current biometry set - #11
Merged
Merged
Conversation
`cookiesync auth` on the Mac Studio prints `Touch ID authentication was cancelled or denied` right after a correct passcode entry. Nothing was cancelled. The unified log for every failed run since 01:02 today reads: ``` authkit: vault-batch-retrieve: SecItemAdd failed: The user name or passphrase you entered is not correct. (OSStatus -25293) ``` This is the vault's copy of the bug #3 fixed in the attestor. The vault ACL was `[.biometryCurrentSet, .or, .devicePasscode]`, and macOS binds that flag to the current fingerprint database at `SecItemAdd`. This Studio has no usable Touch ID right now. coreauthd reports `-13 Accessory disconnected and biometry not enrolled` and `bioutil -c` counts zero templates, so coreauthd logs `Failed to get bio database hash` and the add fails with `errSecAuthFailed`. `batchRetrieve` hit it on re-enrollment. Because `enroll` deletes the old item before adding the new one, the first failure left the vault item gone, and every later tap went through the same failing re-enroll. `HelperFailure.failed` exits 1, the same code as a denial, so cookiesync reported it as a cancelled prompt. A standalone probe on this Mac reproduces the split: `evaluateAccessControl(.createItem)` fails with LAError -1000 for the old ACL and succeeds for `.userPresence`. The ACL becomes `.userPresence`, which needs Touch ID or the device passcode, the same policy the sheet already evaluates. As in #3, the only loss is invalidation when a finger changes. The passcode already satisfied the old ACL, and an invalidated item was silently re-enrolled under whatever context had just authenticated, so that binding never gated anything. Existing items keep their ACL until they next re-enroll. A failed evaluation also names its LAError code on stderr, such as `denied (LAError -2)`, instead of a bare `denied`, so a caller can show what happened. The changelog cuts 0.3.0, which had shipped from Unreleased, and adds 0.3.1. The flags move to `Vault.accessControlFlags`, and a headless test pins `.userPresence` and checks that `.biometryCurrentSet` is absent.
yasyf
added a commit
to yasyf/cookiesync
that referenced
this pull request
Nov 17, 2026
… claiming a cancel (#26) Yasyf's `cookiesync auth` on the Mac Studio printed `Touch ID authentication was cancelled or denied` right after he typed his passcode correctly. He had not cancelled anything. **What happened:** authkit's `vault-batch-retrieve` authenticated, then failed to re-enroll the vault item with `SecItemAdd failed: ... (OSStatus -25293)`. The vault ACL needed a fingerprint database this Mac does not have right now. authkit exits 1 for a failed operation as well as for a denied sheet, which is the helper contract's documented 1 = failed/denied/cancelled. `ObtainKeys` and `ObtainKeyBiometric` turned every exit 1 into a cancel message and dropped the helper's stderr, which named the real error. **The change:** exit 1 now becomes a `ConsentError` carrying the helper's stderr: ```go case 1: return nil, &ConsentError{Msg: fmt.Sprintf("Touch ID key release failed: %s", bytes.TrimSpace(res.Stderr))} ``` The same failure now reads `Touch ID key release failed: authkit: vault-batch-retrieve: SecItemAdd failed: ... (OSStatus -25293)`, and a real cancel reads `... denied (LAError -2)` once authkit 0.3.1 lands. The error type and its `Denied` verdict stay the same, so routed consent behaves as before. **The enrollment fix itself** is yasyf/authkit#11, which moves the vault to a `.userPresence` ACL. **Tests:** `TestObtainKeysWholeBatchFailures` adds an exit-1 case with the `SecItemAdd` stderr. It asserts the message carries the OSStatus and never says "cancelled". The denied-sheet case now asserts the LAError detail. The changelog cuts 0.35.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cookiesync authon the Mac Studio printsTouch ID authentication was cancelled or deniedright after a correct passcode entry. Nothing was cancelled. The unified log for every failed run since 01:02 today reads:This is the vault's copy of the bug #3 fixed in the attestor. The vault ACL was
[.biometryCurrentSet, .or, .devicePasscode], and macOS binds that flag to the current fingerprint database atSecItemAdd. This Studio has no usable Touch ID right now. coreauthd reports-13 Accessory disconnected and biometry not enrolledandbioutil -ccounts zero templates, so coreauthd logsFailed to get bio database hashand the add fails witherrSecAuthFailed.batchRetrievehit it on re-enrollment. Becauseenrolldeletes the old item before adding the new one, the first failure left the vault item gone, and every later tap went through the same failing re-enroll.HelperFailure.failedexits 1, the same code as a denial, so cookiesync reported it as a cancelled prompt.A standalone probe on this Mac reproduces the split:
evaluateAccessControl(.createItem)fails with LAError -1000 for the old ACL and succeeds for.userPresence.The ACL becomes
.userPresence, which needs Touch ID or the device passcode, the same policy the sheet already evaluates. As in #3, the only loss is invalidation when a finger changes. The passcode already satisfied the old ACL, and an invalidated item was silently re-enrolled under whatever context had just authenticated, so that binding never gated anything. Existing items keep their ACL until they next re-enroll.A failed evaluation also names its LAError code on stderr, such as
denied (LAError -2), instead of a baredenied, so a caller can show what happened. The changelog cuts 0.3.0, which had shipped from Unreleased, and adds 0.3.1.The flags move to
Vault.accessControlFlags, and a headless test pins.userPresenceand checks that.biometryCurrentSetis absent.