Skip to content

Server, Admin: Require confirmed access for security changes - #393

Merged
lehni merged 1 commit into
mainfrom
feature/confirmed-access
Oct 18, 2026
Merged

lehni merged 1 commit into
mainfrom
feature/confirmed-access

Conversation

@lehni

@lehni lehni commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

A stolen session alone could add its own passkey, turn TOTP on or off, or change the password. Passkeys survive password changes, so a short takeover could become lasting access.

  • app.auth.reconfirmAccessAfter (default '10m'): logging in, or the new 'post confirm-access', gives the session confirmed access for this long. It confirms with the password (plus the code for users with TOTP) or with a passkey.
  • Without confirmed access, these answer 403 with confirmationRequired: 'post password', adding and removing passkeys, turning TOTP on and off ('delete totp' no longer takes a code), and username changes.
  • patch/put reject password, and every write rejects hash.
  • hasConfirmedAccess(ctx) lets apps protect their own actions.
  • Admin: a "Confirm Access" dialog, after which the request is sent again. The Security dialog is always offered.

Behaviour changes: admins no longer set other users' passwords via patch/put; password fields move to the Security dialog.

Reviews: three independent rounds. Their findings are fixed: the hash bypass, account takeover through a username change, the TOTP lockout, the relate gap, and the docs example for delete.

- Add app.auth.reconfirmAccessAfter: logins and 'post confirm-access' confirm the access of the session for this long, default '10m'
- Answer 403 with confirmationRequired to password and username changes, passkey registrations and removals, and turning TOTP on and off without it, which no longer takes a code
- Confirm with the password and the code of users with TOTP, counting wrong codes, or with a passkey, keeping registration and authentication challenges apart
- Reject passwords in the patch and put actions of UsersController, which only change through 'post password', and hashes in all of them
- Ask to confirm the access in the admin when requests answer confirmationRequired and send them again, and always offer the Security dialog for the password
@lehni
lehni force-pushed the feature/confirmed-access branch from ef48f33 to 4e64011 Compare October 18, 2026 10:08
@lehni
lehni merged commit bacaedc into main Oct 18, 2026
8 checks passed
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.

1 participant