Skip to content

Password dictations that quiet-“Copied” land in clipboard history — inject never sees targetIsSecure #348

Open

Description

@rajgharat07

What happened?

README Privacy: anything dictated into a password field is never kept as context. The session honors that for Recent / stt_prompt (targetIsSecure != true before recentDictations.record). Inject never gets the flag.

When the paste degrades to quiet “Copied” (noEditableTarget / targetAppLost), KeyInjector calls clipboard.write — and SystemClipboard’s own comment says a clipboard manager keeping those words is a feature. That write is the non-transient path: no org.nspasteboard.TransientType, and Blurt never defines ConcealedType anywhere. So a password the press already classified as secure still becomes a lasting general-pasteboard string. Maccy (and anything else that only skips Transient/Concealed) archives it.

The suite pins the insecure half on purpose:

// SystemClipboardTests.writeOverwrites
clip.write("transcript")
#expect(pb.types?.contains(SystemClipboard.transientType) == false)
// "Left for the user to keep, so a clipboard manager may record it."

#312 / 0.1.71 added TransientType so success-path pastes stay out of Raycast/Maccy/Alfred. Quiet Copied was left unmarked on purpose for hand-paste of normal text. Nobody wired that degrade through the same secure gate Recent already has — so the #312 promise doesn’t cover the one path that permanently leaves the words around, and that’s exactly the path a password hits when the target isn’t editable at paste time (click away, app quit mid-transcribe, activate lost, native non-opaque app with nothing focused).

Steps:

  1. Focus a native password field (System Settings / login sheet / AXSecureTextField — not Electron; those still paste via the opaque bypass).
  2. Dictate a throwaway secret.
  3. Before paste lands, make the target non-editable at inject time: quit the app mid-“Transcribing…”, or click a non-text surface so hasEditableFocusedElement is false after activate.
  4. Pill shows Copied (not a red failure). Check pasteboard types — only the string flavor, no TransientType, no ConcealedType. With Maccy running, the secret is in history.

Expected: known-secure dictations never become a lasting clipboard / manager entry (skip the quiet write, or mark Concealed+Transient and clear after a short handoff). Same spirit as skipping Recent.

Actual: Recent withheld; password sits on NSPasteboard.general unmarked; managers keep it. Inject API never learned targetIsSecure.

Pointers:

  • DictationSession+Pipeline — remember gated on targetIsSecure; inject / insert never receive it
  • KeyInjector.performInsert — clipboard.write(finalText) on activate-fail and !hasEditableTarget
  • SystemClipboard.write / setString(_:transient:) — quiet path transient: false; no ConcealedType in the tree
  • SystemClipboardTests.writeOverwrites — asserts TransientType absent on write
  • Maccy ignores only Transient/Concealed/AutoGenerated (nspasteboard.org) — unmarked string is stored

Not #335 (Recent / stt_prompt when security unknown). Not #310/#312 (TransientType on the success paste). Not #347 (restore wiping the user’s prior Concealed clipboard). Not #334/#341 (cancel / layout races). This is known-secure → quiet leave-behind → manager history of Blurt’s own paste.

macOS and Blurt versions

macOS 15+ · Blurt built from main

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions