[extension] Fields: a 2FA field in Firefox (autocomplete from the attribute); 0.22.1 #31

Manually merged
mnovak merged 1 commits from fix/gecko-otp into main 2026-12-03 02:14:23 +01:00
Owner

What

Found by the first end-to-end run in Zen (Gecko 160): Gecko's HTMLInputElement.autocomplete is '' for a token it does not know, and it does not know one-time-code. So in Firefox a 2FA field marked only autocomplete="one-time-code" got no Custos button, and the 2FA code was never offered there.

  • The content script reads the page's autocomplete words from the attribute (getAttribute('autocomplete')), for the 2FA field, the username, and new/current passwords alike.
  • A numeric field (inputmode=numeric) named or id'd code counts as a 2FA field too; type=number counts as a text field for the username.
  • 0.22.1.

Self-review

The change only widens which fields get Custos's button; what may be filled where is still decided by the background and by Custos (origins from the browser, fill_allowed). A page that names a field code gets, at most, the 2FA code of its own site's login after a click.

Tests

  • node tools/extension-test.mjs: 11 passed.
  • End to end (Custos repo, e2e/browser, a test Custos and the built extension): Zen 18/18, Edge 21/21, Chrome 21/21, including the 2FA page in each.
## What Found by the first end-to-end run in Zen (Gecko 160): Gecko's `HTMLInputElement.autocomplete` is `''` for a token it does not know, and it does not know `one-time-code`. So in Firefox a 2FA field marked only `autocomplete="one-time-code"` got no Custos button, and the 2FA code was never offered there. - The content script reads the page's autocomplete words from the attribute (`getAttribute('autocomplete')`), for the 2FA field, the username, and new/current passwords alike. - A numeric field (`inputmode=numeric`) named or id'd `code` counts as a 2FA field too; `type=number` counts as a text field for the username. - 0.22.1. ## Self-review The change only widens which fields get Custos's button; what may be filled where is still decided by the background and by Custos (origins from the browser, `fill_allowed`). A page that names a field `code` gets, at most, the 2FA code of its own site's login after a click. ## Tests - `node tools/extension-test.mjs`: 11 passed. - End to end (Custos repo, e2e/browser, a test Custos and the built extension): Zen 18/18, Edge 21/21, Chrome 21/21, including the 2FA page in each.
mnovak added 1 commit 2026-12-03 02:14:04 +01:00
mnovak manually merged commit c8020f0964 into main 2026-12-03 02:14:23 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/CustosPublic#31