Summary
Doorman versions v0.1.0 and v1.0.2 contain an improper access control flaw in the /platform/user/{username} endpoint that allows any authenticated user to modify their own role field.
Because self-updates do not enforce a manage_users permission check, users can escalate their privileges to non-admin but high-privileged roles, bypassing intended authorization boundaries.
Affected context
This vulnerability arises in Doorman deployments where:
- The
/platform/user/{username}endpoint is exposed to authenticated users for profile or account updates. - The same update model is used for both administrative and self-service user updates.
- Role-based access control is enforced at the application layer, but the
rolefield is not explicitly restricted during self-updates.
Under these conditions, any logged-in user can influence their own authorization level by modifying their role value in an update request.
Exploit preconditions
- Attack surface: Application HTTP API, specifically
PUT/PATCH /platform/user/{username}(or equivalent) endpoint. - Required access: Valid authenticated user account with permission to update its own user record.
- Trigger point: Sending an account update request that includes a modified
rolevalue for the calling user. - Why exploitation is possible: The update handler accepts the
rolefield from the request body and applies it to the current user's account without verifying that the caller holds themanage_users(or equivalent) permission when performing a self-update. The authorization logic incorrectly assumes that authentication alone is sufficient for changing self attributes, treating role changes like ordinary profile updates.
Why this happens
The core issue is an authorization logic gap mapped to CWE-269: Improper Privilege Management.
The application shares a common update model for both administrative user management and self-service profile updates, but fails to distinguish between sensitive security attributes (like role) and non-sensitive attributes (such as name or contact details).
As a result, the same endpoint that administrators use to manage user roles is accessible to ordinary users for their own accounts, without enforcing a dedicated permission check (manage_users) when the target user is the caller.
This reflects a broken separation of duties in the authorization model and a lack of explicit server-side checks around privilege changes, allowing the client to control their own security attributes.
Potential impact
- Users may escalate themselves to high-privileged non-admin roles that grant access to sensitive data or operations.
- Compromised low-privileged accounts can be turned into powerful footholds for broader system compromise.
- Access control policies and audit trails can be circumvented, undermining trust in role-based security controls.
- High-privileged actions such as managing resources, viewing restricted information, or invoking administrative-like workflows may be performed by unauthorized users.
- Security monitoring and governance assumptions based on role separation may become invalid, increasing the risk of data breaches or configuration tampering.
General mitigation guidance
Effective mitigation centers on hardening authorization checks and separating control over security-sensitive attributes:
- Enforce explicit permission checks: Require a dedicated privilege (e.g.,
manage_usersormanage_roles) before accepting any change to a user'srole, regardless of whether the target is self or another user. - Separate update paths: Use distinct endpoints or handlers for administrative user management and self-service profile updates, ensuring that role changes only occur via administrative workflows.
- Restrict writable fields for self-updates: Define whitelists of allowed fields for self-service updates (e.g., display name, contact info) and exclude security attributes like roles, permissions, or status flags.
- Apply server-side validation and policy: Treat role assignments as a controlled resource, validating them against allowed transitions, organizational policy, and least-privilege defaults.
- Implement defense-in-depth checks: Even within admin interfaces, verify that the acting user's own role hierarchy allows granting the target role, preventing privilege creation loops.
How teams detect issues like this
Detection typically involves both code-level analysis and runtime monitoring:
- Static analysis and code scanning:
- Search for user update endpoints that accept role-related fields from client input.
- Flag patterns where security-sensitive attributes (role, permission sets, account type) are updated without surrounding authorization checks.
- Identify shared models or DTOs used for both administrative and self-update flows.
- Code review cues:
- Verify that each endpoint updating roles has an explicit, centralized authorization check.
- Look for generic "update user" functions invoked from different contexts, ensuring that the caller's permissions are validated per context.
- Review controller or handler logic for conditions like
if username == current_userthat may bypass stronger checks. - Runtime monitoring and policy enforcement:
- Log all role-change events with actor, target, old role, and new role, and alert on unexpected patterns such as low-privileged users assigning themselves elevated roles.
- Implement anomaly detection for sudden increases in privileged users or atypical role changes.
- Automated review tools:
- Integrate authorization-focused linters or security analyzers into CI that can detect insecure direct manipulation of security attributes based on request payloads.

