umami: team manager demotes the team owner and removes them from the team
A user with the role team-manager lowers the role of the team-owner through the team API and then removes them from the team; the original owner loses access to the team and its websites.
Advisory ID: TP-2026-134
Product: umami (self-hosted web analytics)
Vulnerability type: Incorrect authorization, missing role hierarchy check in team management (CWE-863)
CVE: not requested
CVSS 3.1: 7.1 (High) · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Affected versions: up to and including 3.1.0 (tested: 3.1.0)
Fixed in: 3.2.0
Reported: 18 May 2026
Summary
umami is a self-hosted web analytics tool in which teams analyse websites together. A team has the roles team-owner, team-manager, team-member and team-view-only; only the owner may delete the team or transfer websites to users. The API for changing and removing members checks only the permission team:update, which owner and manager both hold, and does not compare the rank of the actor with that of the target. The interface hides the buttons in the owner's row, but the server does not enforce that boundary. An invited team manager therefore demotes the owner, removes them from the team and keeps control of the team and its websites.
Root cause
canUpdateTeam returns true for every team member with PERMISSIONS.teamUpdate (src/permissions/team.ts:30-42), and both team-owner and team-manager carry that permission (src/lib/constants.ts:195-205).
After that check the POST handler calls updateTeamUser without comparing the rank of the actor with that of the target (src/app/api/teams/[teamId]/users/[userId]/route.ts:45-55).
The DELETE handler checks only canDeleteTeamUser and then deletes the membership (src/app/api/teams/[teamId]/users/[userId]/route.ts:72-82).
teamRoleParam excludes team-owner as a target role (src/lib/schema.ts:88), which prevents self-promotion but not demoting the owner.
The interface hides edit and remove in the owner's row (src/app/(main)/teams/[teamId]/TeamMembersTable.tsx:36), and the server has no matching check.
Proof of Concept
POST /api/teams/<teamId>/users/<userId of the owner> HTTP/1.1
Authorization: Bearer <token of the team manager>
Content-Type: application/json
{"role": "team-view-only"}
DELETE /api/teams/<teamId>/users/<userId of the owner> HTTP/1.1
Authorization: Bearer <token of the team manager>
Verified on 3.1.0: the team manager demoted the owner to team-view-only, removed them from the team and then changed the team name and access code; the original owner had no access any more. From 3.2.0 the server compares the rank of the actor with that of the target in both handlers; we checked that in the source, not against a running instance.
Impact
- The owner loses access to their team and to the analytics of the team websites.
- The team manager remains as the highest-ranked member and changes team name, access code and websites at will.
- The attack requires an invitation as
team-manager; the attacker reads no new data, since that role sees the team websites anyway.
References
Is Something Like This in Your Software?
Our team found this vulnerability during its work. Have your applications tested by the same specialists, with a penetration test from turingpoint.
