Skip to content

fix(attestor): require user presence instead of the current biometry set - #3

Merged
yasyf merged 1 commit into
mainfrom
fix/attestor-user-presence
Oct 6, 2026
Merged

yasyf merged 1 commit into
mainfrom
fix/attestor-user-presence

Conversation

@yasyf

@yasyf yasyf commented Oct 6, 2026

Copy link
Copy Markdown
Owner

sudo cc-sudo install on the Mac Studio still fails at keygen after #1, now with a different error:

authkit: keygen: SecKeyCreateRandomKey failed: ... (OSStatus -25293 - Failed to generate keypair)

The attestation key's ACL included .biometryCurrentSet. To create a key under that flag, the Enclave binds it to the current fingerprint database. When Touch ID is unavailable, coreauthd can't read that database's hash, and SecKeyCreateRandomKey fails with errSecAuthFailed. This Studio's Touch ID keyboard reports -13 biometryDisconnected right now. coreauthd's log at the failed run reads Failed to get bio database hash. A standalone Enclave keygen under the old ACL reproduces the same error.

The ACL becomes [.userPresence, .privateKeyUsage]: every signature still needs Touch ID or the device passcode. Signing already evaluates .deviceOwnerAuthentication, so the consent flow is unchanged. The one thing this gives up is invalidation when a finger is added or removed; the passcode already satisfied the old ACL, so that binding was never a hard gate. Existing keys keep their ACL, because ensureKey() never rotates.

The flags move to SEAttestor.accessControlFlags, and a headless test pins .userPresence and the absence of .biometryCurrentSet.

Claude-Session-Id: 900424b6-7393-480c-a26a-f1bd21da6e57
@yasyf
yasyf merged commit a9700af into main Oct 6, 2026
5 checks passed
@yasyf
yasyf deleted the fix/attestor-user-presence branch October 6, 2026 10:11
yasyf added a commit that referenced this pull request Nov 17, 2026
…#11)

`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.
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.

1 participant