Repository navigation
Withhold a hand-back's request from the dev log when field security is unknown - #391
Merged
Merged
Conversation
…s security is unknown The hand-back ending returned before the unknown-security substitution, so a request spoken over a field Accessibility couldn't read was logged verbatim, where a pasted dictation into the same field is logged as unverifiedTranscript. security and the loggable text are now read once, before either ending. Found by an automated security review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
An automated security review of
DictationSession+Pipeline.swiftfound a gap between two paths that should behave the same.#358 withholds a dictation's transcript from the developer-mode log when the target field's security is unknown: the Accessibility read hadn't landed, or reached no focused element. The log then records
DictationLog.unverifiedTranscriptinstead of the words.The hand-back ending (read-aloud's "ask about the selection", the Rewrite and Compose keys) returns before that substitution. So a spoken request over a field of unknown security was logged verbatim. A known password field was already safe on both paths, because
DictationLogwithholds ontargetIsSecureitself.Fix
securityand the loggable text are now read once, before either ending, and bothlogTranscriptcalls use them. The remember decision is unchanged; it uses the samesecurityit always did.Test
DictationSessionUnknownSecurityTests.handBackOverUnknownFieldIsWithheld: a hand-back press over an.unreachablefield ends.handedBackand logsunverifiedTranscript. It fails against main's code and passes with the fix.The full engine suite passes, and swift-format and SwiftLint (strict) are clean.
The review's other two findings
capturedContextispressContext?.resolved(DictationSession.swift:93), the same valuetargetSecuritycomes from. A.secureverdict therefore always reaches the log astargetIsSecure == true, and the log withholds it.unknowncovers every dictation whose Accessibility read didn't land in time or found no focused element, which is routine in Electron apps and browsers. Concealing those would mark ordinary "Copied" leave-behinds as secret and clear them after 90 s. It also wouldn't match Never replay dictations into fields whose security is unknown #358's own split, whereunknownstays local (Recent) but never goes on the wire.🤖 Generated with Claude Code