Skip to content

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
Hona merged 1 commit into
devfrom
fix/586-secure-a11y-autofill
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/586-secure-a11y-autofill

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

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

Channel Before After
AccessKit tree (all platforms), a11y/text.rs Secure inputs got TextRun children whose value was the revealed plaintext or one mask dot per character, with per-character lengths, positions, widths and a text selection A secure node gets no runs, no selection and no long-field line nodes; a11y_drawn_text and a11y_drawn_len return None
AccessKit actions, a11y/node.rs, a11y/actions.rs The password node advertised SetTextSelection Not advertised, and refused. Click, Focus, SetValue and ReplaceSelectedText stay. Queued values are Zeroizing with a redacted Debug
AccessKit fingerprint, a11y/node.rs, a11y/tree.rs Caret offsets and the layout address of a secure field fed the fingerprint Not hashed for secure nodes; the subtree under a secure container is left out
Web mirror, runtime/web/a11y.rs Text under a .secure() container was mirrored, and a button's label read secure descendants Secure nodes and their subtrees are skipped
--html export, runtime/web/export.rs Secure labels exported their mask, and secure containers their children Secure nodes and their subtrees are left out
--tree dump, tooling/trace.rs The caret rect of a secure field Omitted
Event log and trace, runtime/input/keys.rs key {:?} for an app-handled key while a secure field had focus key [redacted]
TextEdit Debug, rune-edit/src/lib.rs anchor and focus showed the byte length Redacted when secure

Trade-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]
Loading
  • bridge.js: autocomplete="current-password". secureKind and passwordInput are exported and unit-tested in bridge.test.mjs. Without Intl.Segmenter, every insertText counts as typing.
  • runtime/web/runtime.rs: web_secure_replace checks focus and secure focus as web_secure does, and logs and mirrors nothing.
  • WEB.md and scripts/web-input-smoke.mjs describe and exercise fills. The browser smoke needs Playwright and was not run.

…sibility, mirrors, dumps or logs, and a web autofill replaces typed text
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.

Secure fields: the accessibility tree carries a password or its length, and a web autofill is added to what was typed; fixes are on a fork

1 participant