Summary
A broken authorization check in Wazuh's user-management API can cause requests to be evaluated without the authenticated administrator's identity. An authenticated user with the users_admin role may overwrite passwords for protected administrator accounts, potentially gaining full administrative control.
Affected context
The vulnerability affects Wazuh deployments in which the security user update endpoint processes requests using the user value supplied in the request rather than the authenticated subject recorded in the access token. The issue becomes risky when an authenticated account has the users_admin role and protected administrator accounts use reserved user IDs at or below 99. The flaw is present in affected release ranges before the corresponding security fixes.
Exploit preconditions
- Attack surface: Authenticated Wazuh API user-management endpoint
- Required access: A valid authenticated account with the users_admin role
- Trigger point: Updating a user through the security user update operation
- Target condition: The target is a protected account using a reserved user ID at or below 99
- Why exploitation is possible: The authorization logic receives a request-controlled user value instead of the authenticated token subject, and omission of the resulting null value prevents reserved-account protection from reliably identifying the requester
Why this happens
The underlying bug is an identity-confusion authorization failure. The API passes a user value derived from request data into authorization-related processing instead of consistently using the authenticated subject from the token context. A helper then removes the null value, preventing downstream reserved-account checks from receiving the identity they require. This maps to CWE-863, Improper Authorization, because access-control decisions can be made without reliably binding the operation to the authenticated principal.
Potential impact
- An attacker may overwrite passwords for protected administrator accounts.
- An attacker could take over the Wazuh superuser account.
- An attacker may gain broad administrative control over Wazuh-managed security operations.
- An attacker could alter monitoring, detection, response, or user-management settings.
- An attacker could use administrative access to facilitate further compromise of connected systems.
General mitigation guidance
Mitigation generally focuses on binding every authorization decision to the authenticated identity from trusted token or session context rather than to request-supplied identity fields. Protected-account checks should fail closed when the authenticated subject is absent, malformed, or inconsistent, and reserved accounts should require explicit policy enforcement for sensitive operations. Secure-by-default patterns include centralized authorization, immutable identity context, strict role and object-level checks, and separate controls for password changes on highly privileged accounts. Administrative roles and API service permissions should follow least privilege, while sensitive account-management actions may also benefit from reauthentication, approval workflows, or stronger authentication controls.
How teams detect issues like this
Detection approaches can include static analysis and code review rules that flag authorization decisions based on request parameters instead of trusted authentication context. Reviewers can look for identity fields copied from request bodies, query parameters, or headers; helpers that silently remove missing identity values; and authorization checks that do not fail closed. API policy tests should verify that users cannot modify protected accounts unless the authenticated principal is explicitly authorized, including cases with missing, conflicting, or forged identity fields. Runtime monitoring can alert on password changes affecting reserved accounts, unusual users_admin activity, and administrative changes originating from unexpected sessions.

