Skip to content

security: require password confirmation for sensitive account actions#347

Merged
eugenioenko merged 2 commits into
mainfrom
security/require-password-confirmation-180
May 10, 2026
Merged

security: require password confirmation for sensitive account actions#347
eugenioenko merged 2 commits into
mainfrom
security/require-password-confirmation-180

Conversation

@eugenioenko
Copy link
Copy Markdown
Owner

Summary

Closes #180

  • TOTP setup, passkey registration, and passkey deletion now require current_password in the request body
  • Email and username changes require current_password when the value actually changes (non-sensitive fields like name, phone, etc. do not)
  • Email change resets is_email_verified to false, so the next login forces re-verification when RequireEmailVerification is enabled
  • Passkey-only users (no password set) skip the password check gracefully — the security boundary is their authenticated session
  • Account UI shows a password prompt modal before sensitive actions via a new reusable PasswordPrompt component

Breaking change for API consumers

The following account API endpoints now require a current_password field in the JSON request body:

Endpoint When required
PUT /account/api/profile When email or username is changing
POST /account/api/mfa/totp/setup Always
POST /account/api/passkeys/register/begin Always
DELETE /account/api/passkeys/{id} Always

Test plan

  • Unit tests: password required for email change, username change, TOTP setup, passkey add/delete
  • Unit tests: wrong password returns 403
  • Unit tests: passkey-only users (empty password) can still perform actions
  • Unit tests: non-sensitive fields (given_name, etc.) do not require password
  • Unit tests: email change resets is_email_verified
  • Unit tests: same email/username does not trigger password prompt
  • Security tests: IDOR test updated and passing
  • E2E tests passing
  • Frontend builds successfully
  • Manual test: profile page password prompt on email/username change
  • Manual test: TOTP setup password step
  • Manual test: passkey add/delete password prompt

🤖 Generated with Claude Code

…#180)

Sensitive account operations now require the user's current password
before proceeding. This prevents session-to-credential escalation
where a stolen session could be used to enroll attacker-controlled
MFA devices or change the account email.

Changes:
- TOTP setup, passkey registration, and passkey deletion require
  current_password in the request body
- Email and username changes require current_password when the
  value actually changes (non-sensitive fields like name do not)
- Email change resets is_email_verified to false
- Passkey-only users (no password set) skip the check gracefully
- Account UI shows password prompt modal before these actions
- New reusable PasswordPrompt component for the account UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eugenioenko eugenioenko merged commit b503da5 into main May 10, 2026
15 of 16 checks passed
eugenioenko added a commit that referenced this pull request May 10, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eugenioenko added a commit that referenced this pull request May 10, 2026
…otes (#345)

* docs: complete v2.0 changelog with all breaking changes and release notes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add password confirmation feature (#347) to changelog

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

security: account-ui passkey and TOTP setup should require password confirmation

1 participant