GHSA-rjvx-x5h2-6px5Medium▾ SunlitGitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions
▾ Sunlit zone — Low / medium · no exploitation signal
impact 27.5 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
The API endpoint used to fork repositories into organizations performs a weaker authorization check than the corresponding web UI and other repository creation endpoints.
When a repository is forked into an organization through the API, the endpoint only verifies that the user is an organization member (IsOrgMember()), but does not verify whether the user is allowed to create repositories in that organization (CanCreateOrgRepo()).
As a result, organization members belonging to teams with can_create_org_repo=false can still create repositories inside the organization by using the fork API.
Affected endpoint:
POST /api/v1/repos/{owner}/{repo}/forks
In routers/api/v1/repo/fork.go, the endpoint performs the following authorization check:
if !ctx.Doer.IsAdmin {
isMember, err := org.IsOrgMember(ctx, ctx.Doer.ID)
if !isMember {
ctx.APIError(http.StatusForbidden, ...)
return
}
}
The equivalent web UI implementation uses the stronger permission check:
isAllowedToFork, err := organization.OrgFromUser(ctxUser).
CanCreateOrgRepo(ctx, ctx.Doer.ID)
The same CanCreateOrgRepo() authorization check is also used by:
The fork endpoint appears to be the only repository creation path that relies solely on organization membership.
Tested on Gitea 1.23.7.
can_create_org_repo=false.POST /api/v1/orgs/target-org/repos
Result:
403 Forbidden
POST /api/v1/repos/admin/public-repo/forks
Content-Type: application/json
{
"organization": "target-org"
}
Result:
202 Accepted
The repository is successfully created despite repository creation permissions being disabled.
Users who are organization members but are intentionally prevented from creating repositories can bypass that restriction through the API.
This allows unauthorized repository creation inside the organization and may expose additional attack surface depending on the organization's Actions, runner, and workflow configuration.
The vulnerability represents an authorization bypass because API behavior is less restrictive than both the web UI and other repository creation endpoints.
code.gitea.io/gitea < 1.26.0Upgrade to a patched release:
code.gitea.io/gitea 1.26.0Connected by shared product, vendor, weakness, or advisory.
GO-2026-6074NoneGitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions in code.gitea.io/gitea
CVE-2026-55987High· 8.1Gitea: OAuth2 sign-in reactivates an administrator-deactivated account on auth sources without refresh tokens (incomplete fix of #38009)
CVE-2026-57897Medium· 6.5Gitea: Cross-Repo Information Disclosure via Org-Level Actions Run/Job APIs
CVE-2026-59766Medium· 4.3Gitea CVE-2026-20800 sibling endpoints not covered: revoked user still reads private repo objects via `/api/v1/user/starred` and private issue titles via `/api/v1/user/times`
CVE-2026-58439High· 8.1Gitea: Branch Protection Bypass via PR Retargeting Preserves Stale `official` Approval Flag
CVE-2026-56443Medium· 4.3Gitea: Token public-only scope bypassed on Limited-visibility owners (Repository + Package categories) — residual after CVE-2026-25714 / …