feat(settings): suppress browser autofill on email / delete-account forms #98
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/bunyip!98
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-upgrade-02-settings-hygiene"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Settings was rendering with the user's saved email pre-filled in the "New Email Address" input, and with dots in all three password fields (change-email current_password, change-password current_password, delete-account password). Both were browser autofill driven off the saved login credential, not server-side pre-fill - but the visual effect was the same: confusing on the email-change form (the user has to clear it before typing the NEW address) and genuinely risky on the delete-account form (a password manager pre-fill plus a single misclick could permanently delete the account).
The three forms differ in what we want the password manager to do, so the autocomplete hints differ too:
<form>getsautocomplete="off". The new-email input ALSO getsvalue=""explicitly (defeats the saved-username path) andautocomplete="off". The current-password input here is a confirmation-of-identity step, not a sign-in, so it getsautocomplete="off"too rather thanautocomplete="current-password"(the latter would invite the manager to fill).autocomplete="current-password"so the saved password fills; new_password and confirm getautocomplete="new-password"so the manager offers to save the updated credential after submit.autocomplete="off". The TOTP field (rendered whenuser.two_factor_enabled) picks upinputmode="numeric"andautocomplete="one-time-code"so AutoFill can surface a freshly-arrived code from a sibling tab without touching the password field.autocomplete="off"on password fields is best-effort - some browsers ignore it - but the combination ofautocomplete="off"on the form +value=""+ the absence of the affirmativeautocomplete="current-password"hint is the strongest signal the spec lets us send.Closes audit findings 3 (new-email pre-fill) and 4 (password fields pre-filled). See
docs/bunyip-upgrade/02-settings-form-hygiene.mdfor the full spec.