Summary
An authorization flaw in Coder's user password reset API allows a user-admin to reset the password of an owner account without knowing the current password.
This becomes risky in deployments where the user-admin role is granted to less trusted operators, as it can enable unauthorized takeover of high-privilege accounts.
Affected context
The vulnerability occurs in Coder deployments that expose the PUT /api/v2/users/{user}/password endpoint and use role-based access control with owner and user-admin roles.
It is relevant where user-admin users can manage other users' passwords and where owner accounts hold elevated permissions over organization-wide resources.
Risk is highest in environments that delegate user-admin capabilities to operators who are not fully trusted or who have broader access than necessary.
Exploit preconditions
- Attack surface: Coder HTTP API (
PUT /api/v2/users/{user}/password) - Required access: Valid account with the privileged
user-adminrole - Trigger point: Issuing a password reset request targeting an account that holds the
ownerrole - Why exploitation is possible: The endpoint enforces only a general "update personal" action and fails to apply stricter checks for owner accounts or require the current password when resetting another user's credentials
Why this happens
The underlying issue is an authorization design flaw where the password reset endpoint does not properly differentiate between self-service password changes and administrative resets for high-privilege accounts.
By relying solely on a broad ActionUpdatePersonal permission, the system omits critical checks such as verifying that only the account owner can change their own password or requiring additional proof-of-possession for administrative resets.
This maps to CWE-285: Improper Authorization, in which access control policies are implemented in a way that allows users with certain roles to perform actions beyond their intended scope.
Potential impact
- A
user-adminmay take over anowneraccount by resetting its password. - Attackers with
user-adminaccess could gain indirect control over organization-wide resources managed by owner accounts. - Administrative boundaries between account roles can be blurred, enabling unauthorized configuration changes or policy updates.
- Audit trails may show seemingly legitimate admin actions, complicating incident response and accountability.
General mitigation guidance
Effective mitigation typically focuses on tightening role-based access control rules and enforcing stricter ownership checks around credential operations.
Common patterns include:
- Ensuring that only the account owner can change their own password unless explicitly performing a privileged recovery workflow.
- Introducing role-aware logic so that high-privilege accounts receive additional protection, such as prohibiting resets by lower-tier admins.
- Requiring proof-of-possession (current password or strong second factor) for password changes, even in administrative paths, where appropriate.
- Minimizing assignment of broad administrative roles like
user-adminand aligning privileges with clearly defined trust levels and duties.
How teams detect issues like this
Organizations can detect and monitor similar authorization weaknesses by:
- Reviewing API access control rules to verify that sensitive operations (password changes, token issuance, role changes) enforce strict ownership and role checks.
- Using static analysis or policy-as-code tools to scan route handlers for missing authorization branches or overly broad permissions.
- Conducting targeted code reviews on authentication and user management modules, looking for endpoints that modify credentials or roles without validating the actor's relationship to the target account.
- Enforcing logging and alerting for administrative password reset actions, then periodically auditing those events for misuse or anomalous patterns.

