Repository navigation
fix(a11y): secure fields expose no text, length or selection to accessibility, mirrors, dumps or logs, and a web autofill replaces typed text - #1607
Merged
Conversation
…sibility, mirrors, dumps or logs, and a web autofill replaces typed text
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.
Fixes #586
Two defects in secure fields: their text and length left the process through the accessibility tree and nearby exports, and a web autofill was appended to the typed text.
Leaks closed
a11y/text.rsTextRunchildren whose value was the revealed plaintext or one mask dot per character, with per-character lengths, positions, widths and a text selectiona11y_drawn_textanda11y_drawn_lenreturnNonea11y/node.rs,a11y/actions.rsSetTextSelectionZeroizingwith a redactedDebuga11y/node.rs,a11y/tree.rsruntime/web/a11y.rs.secure()container was mirrored, and a button's label read secure descendants--htmlexport,runtime/web/export.rs--treedump,tooling/trace.rsruntime/input/keys.rskey {:?}for an app-handled key while a secure field had focuskey [redacted]TextEditDebug,rune-edit/src/lib.rsanchorandfocusshowed the byte lengthTrade-off: with no runs, a screen reader can't move through a secure field by character or follow its caret, as native password fields also hide.
Web autofill
flowchart LR I[password input event] --> K{secureKind} K -->|one-grapheme insertText| S[secure: type at caret] K -->|no inputType, insertReplacementText, multi-grapheme, :autofill| R[secure_replace] R --> W[web_secure_replace: select all, then paste, as one edit]bridge.js:autocomplete="current-password".secureKindandpasswordInputare exported and unit-tested inbridge.test.mjs. WithoutIntl.Segmenter, everyinsertTextcounts as typing.runtime/web/runtime.rs:web_secure_replacechecks focus and secure focus asweb_securedoes, and logs and mirrors nothing.WEB.mdandscripts/web-input-smoke.mjsdescribe and exercise fills. The browser smoke needs Playwright and was not run.