Repository navigation
Conceal a possible password left on the clipboard when the field can't be checked - #406
Merged
Merged
Conversation
…t be checked Two gaps in the #348 clipboard protection, found in a security review of the changes since v0.1.71: - The injector concealed only a field positively read as a password one. A press whose Accessibility read never landed, or reached no focused element, pasted as an ordinary field — though #358 and #391 already treat that verdict as possibly secure for Recent and the developer log. In a browser or Electron app, where a login form is as invisible to Accessibility as a chat box, a failed paste left the password on the clipboard for good, kept by clipboard managers and synced over Universal Clipboard. `PressContext.TargetSecurity` becomes the public `TargetSecurity` and rides `InjectorProtocol.insert` in place of `secure: Bool`, so all three decisions share one verdict. `KeyInjector` conceals `.secure` always and `.unknown` only in an AX-opaque app: elsewhere a password field is readable as one, and "unknown" means nothing was focused — the everyday dictate-to-clipboard copy, which stays an ordinary copy. The iPhone conceals `.secure` only; its keyboard always reports the field. - A concealed paste over a pasteboard that couldn't be snapshotted left the words in place (nothing to restore) with no expiry. It now gets the same 90-second clear as a concealed leave-behind. The expiry is scheduled through an injectable `SystemClipboard.ExpiryScheduler` so tests run it without waiting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1U2sb9p3NptGswUznF
alexkroman
enabled auto-merge
November 25, 2026 16:22
KeyInjectorSecureTests now reads NSRunningApplication.processIdentifier, so it imports AppKit rather than Foundation (MemberImportVisibility). The expiry recorder answers isEmpty, for SwiftLint's empty_count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1U2sb9p3NptGswUznF
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
#406 already conceals a leave-behind whose target's security is unknown, and decides it better (only in an AX-opaque app, where a login form can't be read), so its pipeline and injector side is taken whole and this branch's own version of that fix is dropped. The restore's fresh expiry for a secret it puts back now goes through #406's injectable ExpiryScheduler, with a test that runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1SexwaDfyq6udYEfD9
3 tasks done
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.
Two gaps in the #348 clipboard protection, found in a security review of the
changes since v0.1.71:
The injector concealed only a field positively read as a password one. A
press whose Accessibility read never landed, or reached no focused element,
pasted as an ordinary field — though Never replay dictations into fields whose security is unknown #358 and Withhold a hand-back's request from the dev log when field security is unknown #391 already treat that
verdict as possibly secure for Recent and the developer log. In a browser or
Electron app, where a login form is as invisible to Accessibility as a chat
box, a failed paste left the password on the clipboard for good, kept by
clipboard managers and synced over Universal Clipboard.
PressContext.TargetSecuritybecomes the publicTargetSecurityand ridesInjectorProtocol.insertin place ofsecure: Bool, so all three decisionsshare one verdict.
KeyInjectorconceals.securealways and.unknownonly in an AX-opaque app: elsewhere a password field is readable as one, and
"unknown" means nothing was focused — the everyday dictate-to-clipboard copy,
which stays an ordinary copy. The iPhone conceals
.secureonly; itskeyboard always reports the field.
A concealed paste over a pasteboard that couldn't be snapshotted left the
words in place (nothing to restore) with no expiry. It now gets the same
90-second clear as a concealed leave-behind. The expiry is scheduled through
an injectable
SystemClipboard.ExpirySchedulerso tests run it withoutwaiting.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01DS5B1U2sb9p3NptGswUznF