Skip to content

Conceal a possible password left on the clipboard when the field can't be checked - #406

Merged
alexkroman merged 2 commits into
mainfrom
claude/stoic-galileo-a7pfwx
Nov 25, 2026
Merged

alexkroman merged 2 commits into
mainfrom
claude/stoic-galileo-a7pfwx

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

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

…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
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
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 54d030c Nov 25, 2026
16 checks passed
@alexkroman
alexkroman deleted the claude/stoic-galileo-a7pfwx branch November 25, 2026 18:01
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
@alexkroman alexkroman mentioned this pull request Nov 25, 2026
3 tasks done
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.

2 participants