Summary
Vikunja's password reset workflow allowed disabled accounts to be silently reactivated because the ResetPassword() function unconditionally set a user's status to active after a successful reset.
A disabled user who can request and complete a password reset could thereby bypass administrator-imposed account disablement and regain access to their account.
Affected context
This vulnerability appears in Vikunja's user management and authentication flows, specifically within the password reset logic.
It manifests when:
- User accounts can be disabled by an administrator (e.g., for policy, security, or lifecycle reasons)
- The same users retain the ability to request password reset tokens
- The reset handler automatically reactivates accounts without checking their previous status or the reason for disablement
In such deployments, any disabled but otherwise valid user identity may be able to self-reactivate via the password reset endpoint.
Exploit preconditions
- Attack surface: Public or user-facing API endpoints:
/api/v1/user/password/token/api/v1/user/password/reset- Required access:
- Knowledge of valid account credentials or at least the email/username of the disabled account
- Ability to receive email (or configured channel) where reset tokens are delivered
- Trigger point:
- Initiating a password reset for a disabled account
- Completing the reset using the issued token so that
ResetPassword()executes - Why exploitation is possible:
- The password reset routine directly sets the user's status to
StatusActiveafter a successful reset. - No authorization or state validation step verifies whether the account was disabled intentionally by an administrator or whether the disablement should persist independently of password resets.
Why this happens
The underlying issue is an authorization logic flaw in the account lifecycle management implemented in the password reset handler.
Instead of treating password resets as a credential update on the existing account state, the implementation implicitly assumed that any successful reset implies a valid, active account and therefore sets the status to active.
This mixes authentication events (proving control over the reset channel) with authorization decisions (whether the account is allowed to be active), violating separation of concerns.
Conceptually, this maps to:
- CWE-284: Improper Access Control, because the system fails to enforce the administrator's decision to keep an account disabled.
- CWE-862: Missing Authorization, as there is no specific check that a disabled account is allowed to transition back to active.
- CWE-863: Incorrect Authorization, since password reset success is incorrectly treated as an authorization to change account status.
Potential impact
- Disabled users may regain full access to their accounts without administrator approval.
- Policy-driven account suspensions (e.g., due to abuse, contractual issues, or security incidents) can be bypassed by the affected users.
- Compliance and audit requirements regarding account disablement may be undermined.
- Lockouts performed in response to suspected compromise may be ineffective, increasing the risk of ongoing unauthorized activity.
General mitigation guidance
Effective mitigation focuses on separating account status management from authentication flows and enforcing explicit, policy-driven checks:
- Treat password reset as a credential change only and preserve the existing account status; do not implicitly activate accounts within reset routines.
- Add explicit state checks so that disabled, banned, or locked accounts cannot be reactivated by self-service flows unless policy explicitly allows it.
- Centralize account status transitions (e.g., active → disabled, disabled → active) in dedicated, admin-only paths with appropriate authorization checks and audit logging.
- Model account states and transitions clearly (state machine or policy rules) to ensure that flows such as password reset, login, and invitation respect those rules.
- Use security reviews and design patterns that keep authentication (identity proof) distinct from authorization (permissions and lifecycle decisions).
How teams detect issues like this
Organizations can detect similar issues by focusing on authorization behavior around account state transitions:
- Code review patterns:
- Examine password reset, login, and registration handlers for any logic that modifies account status, roles, or permissions.
- Verify that state transitions (e.g., to active) always pass through explicit authorization checks and are not tied directly to authentication success.
- Look for hard-coded status assignments (e.g.,
status = Active) that occur without conditionals based on prior state or policy. - Static analysis and policy enforcement:
- Configure rules to flag sensitive field modifications (e.g.,
status,is_active,is_disabled,role) in non-admin code paths. - Use dataflow analysis to trace where account status is written and ensure such writes are restricted to privileged contexts.
- Runtime and log-based detection:
- Monitor for password reset events involving disabled users and alert on subsequent logins from those accounts.
- Correlate admin disable actions with any subsequent self-service events that change account state, treating mismatches as potential control failures.

