GITEA.DEV · CVE-2026-125617 · Runtime
FIX → 28.4.0
Any signed-in Gitea user can check whether another user is a hidden member of a public or limited organization and what role they hold, via GET /api/v1/users/{username}/orgs/{org}/permissions. The other membership routes return the same answer for hidden members as for non-members, so this exposes membership and role metadata only.
first public Nov 15, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Self-hosted Gitea instances running a version from 1.16 up to and including 28.3.0 where organizations have members with concealed (non-public) membership. Exposure needs a signed-in account; on instances with registration disabled this means an existing user. Instances on 28.4.0 or later, or where all memberships are public, are not affected.
Not affected if default-config-public-memberships, registration-disabled-no-users
Who cares gitea, self-hosted
gitea --version (or check the server's version page) and compare against the affected range >= 1.16, <= 28.3.0.[service] DEFAULT_ORG_MEMBER_VISIBLE is set; the default is false, which is the concealed-membership case this bug affects.GET /api/v1/users/{username}/orgs/{org}/permissions as a non-member user with read:user and read:organization scopes and seeing a 200 response.Any signed-in Gitea user can find out whether another user is a concealed member of a public or limited organization, and at what level, by calling GET /api/v1/users/{username}/orgs/{org}/permissions. The possible answers are owner, admin, write, read, or "may create repositories". The routes that normally answer membership questions for outsiders (/orgs/{org}/members/{username}, /orgs/{org}/public_members/{username} and /users/{username}/orgs) give a concealed member the same answer as a non-member. The permissions route tells them apart and adds the role. The attached reproducer runs a default build and queries as a user with no tie to the organization. It gets is_owner: true for the organization's concealed creator and can_read: true for a concealed read-team member, while the three membership routes return 404 / 404 / [] for both.
The only access check in GetUserOrgsPermissions (routers/api/v1/org/org.go) is HasOrgOrUserVisible on the organization. After that, the handler returns the target's GetOrgUserMaxAuthorizeLevel. It never consults or whether the caller is an org member, which is the rule , and apply. Because defaults to false, new memberships start out concealed.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
Upgrade to 28.4.0
28.4.0.org_user.is_publicIsMemberListUserOrgsListMembersDEFAULT_ORG_MEMBER_VISIBLEThe caller needs an account; a token with read:user and read:organization is enough. Registration is off by default, so on a default instance this means an existing user. What leaks is membership and role only: no repository content and nothing about private organizations. Members of teams with only per-unit permissions are not revealed unless that team can create repositories. For organizations with public repositories, the assignees route already names accounts with write access. The new exposure is therefore mainly organizations without public repositories, read-only members, and exact roles.
The private-organization case of this route was fixed in 57b5ed3f25 (#36798), but the per-membership check was never added. Based on a source-level reading of the history, it has been missing since the endpoint was introduced in d0a681fbc3 (#17232), first released in v1.16.0-rc1.
GET /api/v1/users/{username}/orgs/{org}/permissions tells any signed-in user what role {username} holds in {org}, including when that membership is not public. Scanned commit: 31626de2a6cdd3e1fe93216e4ac80f511297f1e7. Attacker position: a regular user with no relation to the organization. Configuration: default.
Observed on the stock build with default settings, as user attacker, against the public organization victimorg whose creator orgowner and team member hiddenmember both have org_user.is_public = false, and against bystander, who is not a member:
request (as attacker) | orgowner | hiddenmember | bystander |
|---|---|---|---|
GET /orgs/victimorg/members/{user} | 303 → public_members → 404 | 303 → 404 | 303 → 404 |
GET /orgs/victimorg/public_members/{user} | 404 | 404 | 404 |
GET /users/{user}/orgs | [] | [] | [] |
GET /users/{user}/orgs/victimorg/permissions | 200, is_owner: true (all five fields true) | 200, can_read: true | 200, all five fields false |
The three routes that answer "is this user a member" give an outsider the same answer for a concealed member and a non-member. The permissions route separates them and adds the role.
The handler's only visibility check is on the organization:
// routers/api/v1/org/org.go:157-163
if !organization.HasOrgOrUserVisible(ctx, o, ctx.Doer) {
ctx.APIErrorNotFound()
return
}
org := organization.OrgFromUser(o)
authorizeLevel, err := org.GetOrgUserMaxAuthorizeLevel(ctx, ctx.ContextUser.ID)
GetOrgUserMaxAuthorizeLevel (models/organization/org.go:416) is max(team.authorize) over the target's team_user rows in the org. Lines 169-186 translate it into can_read / can_write / is_admin / is_owner and add can_create_repository from CanCreateOrgRepo. Neither org_user.is_public for the target nor the caller's own membership is consulted anywhere on the path.
The route is registered at routers/api/v1/api.go:1776-1779. Its guards are reqToken(), the token scopes read:user and read:organization (a token with exactly these two scopes gets the same 200 responses), checkTokenPublicOnly(), and individualPermsChecker (api.go:984), which only requires that {username} is visible to the caller. An anonymous request gets 401.
The siblings do apply the membership rule:
IsMember (routers/api/v1/org/member.go:153-175) answers directly only when the caller is an org member or a site admin; everyone else is redirected to public_members, and IsPublicMember (member.go:204) answers from organization.IsPublicMembership.ListUserOrgs goes through queryUserOrgIDs (models/organization/org_list.go:63-69), which adds is_public = true unless the caller is the user or an admin.ListMembers uses FindOrgMembersOpts.PublicOnly() (models/organization/org.go:180) to restrict non-members to public memberships.Memberships start out concealed: both CreateOrganization (models/organization/org.go:350) and AddOrgUser (org.go:532) insert the org_user row with IsPublic: setting.Service.DefaultOrgMemberVisible, and [service] DEFAULT_ORG_MEMBER_VISIBLE defaults to false (modules/setting/service.go:244).
What the response reveals depends on team.authorize:
authorize = owner, so every concealed owner comes back with is_owner: true.can_read / can_write / is_admin. POST /orgs/{org}/teams with permission and no units/units_map creates such a team for read, write or admin (routers/api/v1/org/team.go:177-181); the web form handler does for write and admin (routers/web/org/teams.go:347). Read and write teams created through the API were observed; the admin case follows from the same comparisons in the handler, and the web-form path was read from source, not run.authorize = none (team.go:170, routers/web/org/teams.go:370). A member of only such teams returns the same all-false body as a non-member, unless the team has can_create_org_repo, in which case can_create_repository: true gives the membership away. Both cases were observed on the running server.A limited organization behaves like a public one for a signed-in caller (observed: 200 with is_owner: true). A private organization returns 404 to non-members; that case was closed by 57b5ed3f25 (#36798), which made HasOrgOrUserVisible test the caller instead of the target. The per-membership check is the part that is still missing; it has been absent since the endpoint was added in d0a681fbc3fb ("[API] Add endpount to get user org permissions (#17232)", 2021-10-12), first released in v1.16.0-rc1.
The attacker needs an account, and what leaks is membership and role metadata only: no repository content, and nothing about private organizations. Registration is disabled by default (DISABLE_REGISTRATION defaults to true, modules/setting/service.go:148), so on a default instance this is an existing user; on instances with open registration it is anyone.
With that, any signed-in user can test any visible username against any public or limited organization and learn whether that user is a concealed owner, or a concealed member of an admin/write/read team or of a team that may create repositories, together with that role. Iterating over usernames lists the concealed members of such an organization with their roles. This defeats the membership-visibility setting that the other organization routes enforce.
That concealment is already partial elsewhere. When the organization owns a public repository, GET /repos/{owner}/{repo}/assignees lists the accounts with write access to that repository to any signed-
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.