Summary
PUT /api/v1/repos/{owner}/{repo}/teams/{team} allows a non-owner repository admin to attach organization teams to a repository even when the organization has disabled that behaviour with RepoAdminChangeTeamAccess=false. An earlier advisory fixed the corresponding team-side endpoint; the repository-side endpoint retained the weaker check.
Details
The repository-side handler's exception relies on a repository permission check (IsOwner()), which for an organization repository is satisfied by a user promoted to owner-level access through an attached admin team. The fixed team-side endpoint instead checks actual organization ownership when RepoAdminChangeTeamAccess is disabled. The matching web collaboration-settings handler had the same weak check.
Impact
A user with delegated admin rights on one organization repository can grant other organization teams read or write access to that repository without approval from an actual organization owner, exposing private source and history and, for a write-capable team, granting push access.
Affected versions
Gitea <= 1.27.2.
Patches
Fixed in Gitea 1.27.3 (#39046, #39058).
Workarounds
None. Upgrade to 1.27.3.
Summary
PUT /api/v1/repos/{owner}/{repo}/teams/{team}allows a non-owner repository admin to attach organization teams to a repository even when the organization has disabled that behaviour withRepoAdminChangeTeamAccess=false. An earlier advisory fixed the corresponding team-side endpoint; the repository-side endpoint retained the weaker check.Details
The repository-side handler's exception relies on a repository permission check (
IsOwner()), which for an organization repository is satisfied by a user promoted to owner-level access through an attached admin team. The fixed team-side endpoint instead checks actual organization ownership whenRepoAdminChangeTeamAccessis disabled. The matching web collaboration-settings handler had the same weak check.Impact
A user with delegated admin rights on one organization repository can grant other organization teams read or write access to that repository without approval from an actual organization owner, exposing private source and history and, for a write-capable team, granting push access.
Affected versions
Gitea
<= 1.27.2.Patches
Fixed in Gitea 1.27.3 (#39046, #39058).
Workarounds
None. Upgrade to 1.27.3.