Skip to content

Keep a password-field dictation withheld from the log after a cancelled paste - #397

Merged
alexkroman merged 2 commits into
mainfrom
security/f7-cancelled-paste-log-redaction
Nov 25, 2026
Merged

alexkroman merged 2 commits into
mainfrom
security/f7-cancelled-paste-log-redaction

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Summary

  • runTranscribeInject read the shared pressContext (via capturedContext) after awaiting the paste. Cancelling during .injecting makes the phase terminal immediately without waiting for the pipeline task, so a new press could install its own PressContext before the old pipeline wrote its developer-mode log line. The log then judged the old transcript by the new press's field (nil, or an ordinary field) and could write a password dictated into a secure field to ~/Library/Logs/Blurt/dictations.jsonl in plaintext.
  • Fix: snapshot this press's context (let press = pressContext) before any await, and choose the logged transcript from that snapshot's security — withheldTranscript for .secure, unverifiedTranscript for .unknown, the text only for .ordinary — then log with press?.resolved. A later press can no longer change what gets redacted.
  • Without the race, the written entry is identical to before (makeEntry already swapped .secure text for withheldTranscript).

Preconditions: developer mode on (opt-in, off by default), a password-field dictation cancelled mid-paste, and a retry press that wins the race. Severity LOW.

Provenance

Found by a Claude Security scan of Sources/ (finding F7). The patch was reviewed by an independent verifier and a fresh adversarial reviewer before it was written; both found no remaining route and no new weakness.

Test plan

  • New CancelledPasteLogTests: parks a secure paste, cancels, accepts a second press whose read lands as an ordinary field, releases the paste, and asserts the password never reaches the log seam
  • swift test --filter 'CancelledPasteLog|DictationSessionContext|DictationSessionUnknownSecurity|CancelRace|DictationLog' — 59 tests passed locally
  • Full swift test -Xswiftc -warnings-as-errors passed in the review workspace (1353 tests)
  • scripts/check.sh --lint-only — swift-format, swiftlint, invariants clean
  • CI

🤖 Generated with Claude Code

alexkroman-assembly and others added 2 commits November 24, 2026 21:23
…ed paste

runTranscribeInject read the shared pressContext after awaiting the paste.
Cancelling during .injecting makes the phase terminal at once, so a new
press could install its own context before the old pipeline logged. The
developer-mode log then judged the old transcript by the new press's
field and could write a password in plaintext to dictations.jsonl.

Snapshot this press's context before any await and pick the logged
transcript (withheld / unverified / text) from that snapshot, so a later
press can no longer change what is redacted.

Found by a Claude Security scan (F7); patch reviewed by its agent panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ity/f7-cancelled-paste-log-redaction

# Conflicts:
#	Sources/BlurtEngine/Pipeline/DictationSession+Pipeline.swift
@alexkroman
alexkroman enabled auto-merge November 25, 2026 05:26
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 97d29ee Nov 25, 2026
15 checks passed
@alexkroman
alexkroman deleted the security/f7-cancelled-paste-log-redaction branch November 25, 2026 06:37
alexkroman pushed a commit that referenced this pull request Nov 25, 2026
The cancelled-paste test reuses GatedInjector rather than a private
copy of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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