Repository navigation
fix: ask before SSH keys leave, keep vault readers consistent across compactions, and eight more review fixes - #368
Merged
Merged
Conversation
… type cancels - `resolve` asks Touch ID before an SSH private key or its passphrase leaves, each time, as `item get` does, and answers only if the references still name what the prompt was about. - Coalesced `deadbolt ask` waiters all check their answer against the card that was approved: the targets travel with the decision, and an approval of a card that named no items approves none. - `item unset` is the same edit as a `set` that unsets, so an SSH key's derived fields follow a removed comment or passphrase. - macOS AutoFill offers quick unlock "With this Mac" too, registers a login for the sites that share its credentials, and runs both passkey ceremonies through one user-verification path. - One classifier names a failure for the reply, the span and the log. A cancelled or unanswered Touch ID prompt is `cancelled` by its type, never by its message. - The AutoFill FFI says per request whether it needs a verified daemon, exhaustively, and passes `wrong-passphrase` to Swift as its own code.
…out the history - `VaultReader` lists the WALs again after choosing its pack and starts over if they moved. Two compactions between its WAL handles and its pack left it a pack whose carried tail was in a WAL it never opened: frames synced before the pack was written went missing, silently. - `MemReader` is a handle on the file, as `FsReader` is: it sees appends made after it opened and keeps reading a deleted file. The simulation no longer has stronger guarantees than the file system. - `VaultDir::open` cuts torn tails off the two logs it can append to and returns which pack is the base. It no longer reads, checksums and copies every WAL and activity log for callers that dropped them; an activity log is cut before the first append to it.
- A store placed by `XDG_DATA_HOME` gets its own daemon socket, as one placed by `DEADBOLT_HOME` does; the default store's names don't move. `ensure_running` refuses a daemon that serves another store. - `request_quit_app` takes the start time read with the pid, as `terminate_pid` does, so a reused pid is never asked to quit. - A failed connect drops what the daemon gave, like a daemon that stopped, in place of only changing the screen. - The quick panel's in-app fallback is the default shortcut's chord on each platform: Ctrl+Shift+Space off macOS. - `deadbolt receive` refuses a bundle whose files would land on each other, with `--force` too. - `deadbolt debug` counts a vault that couldn't load as unavailable, not as one this device was removed from.
…review fixes - An ask's outcome and the targets its card named are read from one place, the settled ask. With no app to show a card, Touch ID's answer settles the ask before any waiter reads the vault: the asker whose prompt it was used to check its own answer first and, when that failed, leave a second identical ask waiting out the minute. - A passkey ceremony passes a cancelled Touch ID prompt on as it comes: it is already `cancelled` by its code. - A Touch ID prompt for SSH keys counts keys, each a vault's item, so two keys that share a title in two vaults read "Deploy and 1 more". What the prompt was about is compared by vault too. - `ensure_running` checks the store of the daemon that answers after a start, as it does one found running. - Pid 0 is never a process to ask to quit or to signal.
kitlangton
force-pushed
the
rust-security-fixes
branch
from
December 2, 2026 21:15
c11baa5 to
3305583
Compare
…on to the same rule - `settle_ask` ends an ask and takes its card down only if it was still the open one, at every place an ask is decided: the unlock-refresh error path cleared the card whether or not it had. - `ensure_running` has one rule (`accept`) for the daemon that answers, found running or just started. One it can't use that answers after a start (unverified, newer, of another build, serving another store) is named at once: it used to be asked again for five seconds and reported as a daemon that did not start, or, of another protocol, taken for one this copy speaks to. The two protocol tests start such a daemon and now expect that first call to name it. - A test's doc comment had three lines of another test's.
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.
hint: if you need to wait for this pull request to be reviewed, merged, or closed before continuing, use this instead of polling:
gh event listen --resource #368 --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1
--timeoutto stop waiting after a while, for example--timeout 30m; it then exits with status 8.gh event listen --helpfor other event types.Ten correctness fixes from a code review: an SSH private key now asks for Touch ID on every way out, a vault reader can no longer silently lose frames across two compactions, and a second store never borrows the first store's daemon.
Each fix comes with a focused regression test. The wire protocol is unchanged (still 38,
crates/protountouched) and there are no new dependencies.❌ Before / ✅ After
deadbolt read/run/injectof an SSH private key or its passphrase, Touch ID ondeadbolt getaskeddeadbolt askcalls wait on one locked card, the item is swapped, the card is approvedtwitter.comlogin never offered onx.com; cancel detected by English textdeadbolt unsetof an SSH key's comment or passphraseset --unsetXDG_DATA_HOMEdeadbolt receive --forcewith two files of the same name in one bundledeadbolt debugwith a vault that failed to load📊 Proof
26 new regression tests, all passing, plus existing tests adapted where an API changed. The two reader-race tests and the headless Touch ID ask test were also run against the old code and fail there; the others were not each re-run against the old code.
cargo test --workspace(before the last commit)cargo clippy --workspace --all-targets -- -D warningscargo fmt --all -- --checkbun run check:wasmbash scripts/file-size.shdevA review round then added five follow-ups in their own commit: with no app running, Touch ID's answer settles a
deadbolt askfor every waiter (a second identical ask used to hang for a minute if the first one's check failed); the SSH Touch ID prompt counts keys, not titles; the store check also runs on a daemon that comes up after a start; pid 0 is never signalled; and one redundant cancel re-wrap is gone.A second round added three more in the last commit: an ask is ended and its card taken down in one place (
settle_ask), so the card is only cleared by whoever actually ended it;ensure_runningholds the daemon that answers to one rule (accept) whether it was found running or just started; and a stray doc comment is gone. The last commit was checked with Clippy and the client,ask::,macos_autofill::and CLI integration tests, not a full workspace run, and CI is green on it.Things that behave differently on purpose:
XDG_DATA_HOMEusers: a store somewhere other than~/.local/share/deadboltnow has its own daemon socket. A daemon already running for it at the old socket should be stopped once (deadbolt debug daemon stop). The default store, and stores placed withDEADBOLT_HOME, keep the names they have.deadbolt askis not behind the new SSH Touch ID prompt: it has its own approval card.touch_id_readystatus field now means "a quick unlock is ready", either kind. Same field, same type.👀 Read:
crates/pack/src/vault_dir.rs, the reader's second WAL listing intry_openand the comment aboveVaultReaderexplaining why opening WALs first was not enough. Next,crates/cli/src/daemon/ask.rs, where targets now travel with the decision and an approval with no recorded targets fails closed. The rest is routine.🔍 Found in a code audit · no user reports · open-time cost not measured
Checks run
cargo test --workspace, before the last commit: 1580 passed, 0 failed, 5 ignored (includes the Swift AutoFill end-to-end runner)cargo test -p deadbolt-client58 passed, 1 ignored;cargo test -p deadbolt-cli --bin deadbolt ask::9 passed;macos_autofill::12 passed;cargo test -p deadbolt-cli --test cli69 passed, 2 failed locally (the two idle-lock tests, which can't pass on a Mac whose keyboard or mouse is in use; they pass in CI)cargo clippy --workspace --all-targets -- -D warnings: no warningscargo fmt --all -- --check: no diffbun run check:wasm: finished, no errorsbash scripts/file-size.sh:over 800: 22, over 1500: 0, prefix families: 0, wide folders: 0, errors: 0, warnings: 29cargo deny,cargo machete(no extension or dependency changes)