Skip to content

compromised account cleanup fails with database inconsistency #1730

@ElectricNroff

Description

@ElectricNroff

If there is a compromised user account, then an administrator must be able to use one of these to prevent access by that account:

PUT /org/{shortname}/user/{username}/reset_secret
PUT /registry/org/{shortname}/user/{username}/reset_secret
PUT /org/{shortname}/user/{username}
PUT /registry/org/{shortname}/user/{username}

Suppose that a user exists in 'registry' but not 'legacy' (e.g., through a bug that is not yet identified or is introduced later).

For reset_secret, this fails with TypeError:

legUser.secret = secret

ultimately causing the transaction to be aborted.

For an attempt to set the user to active: false, this fails with TypeError:

legacyUser.username = incomingParameters?.new_username ?? legacyUser.username

or this occurs:
const legacyUser = await legacyUserRepo.findOneByUUID(identifier)
if (!legacyUser) {
throw new Error('Legacy user not found')

again ultimately causing the transaction to be aborted.

Thus, if this type of database desynchronization ever occurs, there is not simply a minor impact in which the affected user may see anomalous behavior, and instead there is a critical loss of administrative control until the database is repaired.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions