Skip to content

fix(auth): a disabled account keeps its verified addresses, so no new account can register one #653

Closed

Description

@PiquelChips

Disabling an account releases its verified addresses, so another account can verify one of them. The ownership triggers in crates/database/migrations/0001_initial.sql do this on purpose: synchronize_user_email_ownership deletes a disabled account's rows from active_verified_email_ownership, and re-enabling the account fails if someone claimed one in the meantime. docs/dev/architecture/email.md describes the rule.

A new account should not be able to register an address a disabled account holds. Releasing the address on disable also causes the bugs in #614, #620 and #622: a disabled account's announcements and notifications reach an address that now belongs to someone else, or reach one address twice.

Reproduce

Disable account A, then add A's verified address to account B and verify it: the verification succeeds.

Expected

A disabled account keeps its verified addresses until it is purged, as an account being deleted already does. Verifying one of them on another account is refused as OwnedElsewhere, the same as for an active account's address. Re-enabling the account can no longer fail on a lost address.

This replaces the per-channel fixes #619, #621, #625 and #626: once no address can be shared, none of them is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions