Summary
Wiki.js user-management operations can allow an authenticated account with only user-management privileges to change another local account's password and clear its two-factor authentication state. Depending on how the operations are used, this may enable administrator account takeover or removal of administrative access.
Affected context
The issue occurs in Wiki.js user-management operations for local accounts. It becomes risky when an authenticated account with the manage:users permission can invoke operations against accounts with greater privileges, and those operations do not consistently check the target account's privileges or authorization against the requested changes.
Exploit preconditions
- Attack surface: Wiki.js user-management operations, including
users.updateandusers.disableTFA - Required access: An authenticated account with the
manage:userspermission - Target: A local account, potentially including an administrator
- Trigger point: A password or two-factor authentication change, or a group-membership update
- Why exploitation is possible: Authorization checks do not consistently account for the target account's privileges or the effect of omitted or empty group arguments.
Why this happens
This is an authorization failure mapped to CWE-863: Incorrect Authorization. User-management operations permit sensitive changes to a target account without adequately verifying that the acting user is authorized to make those changes, including when group-related arguments are omitted or when changing two-factor authentication state.
Potential impact
- An attacker may take over a local administrator account by changing its password and clearing its two-factor authentication state.
- Removing group relationships could leave an installation without a legitimate account holding system-management privileges.
- Additional administrator accounts may be deactivated or deleted.
- Unauthorized account changes could disrupt administration or compromise wiki content and settings.
General mitigation guidance
Defensive patterns focus on enforcing authorization for every sensitive change, based on both the acting user's permissions and the target account's privileges.
- Apply explicit, server-side checks to password, group-membership, two-factor authentication, deactivation, and deletion operations.
- Treat omitted arguments as distinct from explicitly authorized changes; do not let defaults bypass authorization.
- Validate proposed group changes against a policy that prevents unauthorized privilege changes or removal of all system administrators.
- Use least privilege for user-management permissions and provide safeguards for critical administrative accounts.
- Keep authorization logic centralized and test it across different target roles and argument combinations.
How teams detect issues like this
- Review user-management handlers for checks that authorize only the acting user but do not consider the target account's privileges or the requested change.
- Use static analysis and code review rules to flag sensitive operations with missing authorization checks, especially when optional arguments or defaults affect access control.
- Add policy tests covering password changes, two-factor authentication resets, group removal, deactivation, and deletion across account privilege levels.
- Monitor audit records for sensitive changes made by accounts without corresponding administrative authority, and alert on changes that remove system-management access.

