Summary
A privilege escalation flaw in the Wiki.js users.update GraphQL mutation allows users with manage:users permission to arbitrarily change their own group memberships without validation.
By assigning themselves to the Administrators group, a moderator-level user can gain full site administrator privileges after re-authentication.
Affected context
This vulnerability affects Wiki.js instances that:
- Expose the
users.updateGraphQL mutation - Delegate the
manage:userspermission to non-admin users (e.g., moderators) - Use group-based permissions where membership in a high-privilege group (e.g., Administrators, ID 1) confers system-level capabilities
The issue manifests when the GraphQL resolver accepts and persists arbitrary groups arrays for user accounts without validating group ownership or permissible assignments.
Exploit preconditions
- Attack surface: Authenticated application API via GraphQL (
users.updatemutation) - Required access: A valid account with the
manage:userspermission (commonly granted to moderators or support staff) - Trigger point: Invocation of the
users.updatemutation with a craftedgroupsarray containing a high-privilege group ID (e.g.,groups: [1]) - Why exploitation is possible: The resolver forwards the caller-supplied
groupsarray directly to the data model without: - Validating that the requested groups are allowed targets
- Checking ownership or scope of groups relative to the caller
- Enforcing constraints preventing self-assignment to administrator-level groups
Why this happens
The core issue is improper privilege management and insufficient authorization checks at the business-logic layer.
The users.update GraphQL resolver assumes that any groups array provided by a caller with manage:users is legitimate, and it passes these values directly to the persistence layer.
This design conflates "may update user accounts" with "may assign any group," creating a horizontal-to-vertical privilege escalation path.
Conceptually, this maps to CWE-269: Improper Privilege Management, where the system fails to enforce appropriate authorization boundaries on privilege-bearing attributes such as group membership and role assignments.
Potential impact
- A moderator-level user may promote their own account to the Administrators group.
- An attacker with
manage:userscan gainmanage:systemor equivalent full site administrator capabilities. - Unauthorized modification of global configuration, integrations, and security settings may occur.
- Elevation of other accounts to privileged groups can entrench attacker control.
- Indirect impact on data confidentiality and integrity through unrestricted access to wiki content and system secrets.
General mitigation guidance
Effective mitigations focus on enforcing strict authorization checks and least-privilege role design for group assignments:
- Introduce server-side validation for role and group changes, ensuring only highly trusted principals can assign or modify administrator-level groups.
- Separate "manage user profile data" from "manage user privileges," using distinct permissions and code paths.
- Enforce allowlists or policy rules that define which roles may assign which groups, preventing self-escalation.
- Treat group membership as a sensitive security attribute and require additional checks (e.g., admin-only endpoints or secondary approval) when changing it.
- Periodically review delegated permissions such as
manage:usersto ensure they do not implicitly grant access to privilege-bearing operations.
How teams detect issues like this
Detection typically combines code-level analysis with runtime monitoring:
- Static analysis / code review:
- Look for GraphQL resolvers or REST handlers that accept role/group/permission parameters and pass them directly to models without intermediate authorization checks.
- Flag patterns where the same permission gate controls both general user management and high-privilege assignments.
- Review business logic around group IDs or role names hard-coded as "admin," "root," or ID 1 to ensure additional safeguards exist.
- Runtime and log analysis:
- Monitor audit logs for group membership changes, especially self-assignments to administrator or system roles.
- Alert on unusual spikes in privilege changes, or on privilege elevations followed closely by configuration changes.
- Policy enforcement:
- Apply security policies in CI/CD that require explicit review for any code modifying authorization, roles, or group-assignment behavior.
- Use automated review tools that highlight high-impact authorization paths for manual inspection.

