Résumé
Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions
Détails de l’avis
Summary
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.
Details
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:
- CreateOrgRepo API endpoint
- GenerateRepository API endpoint
The fork endpoint appears to be the only repository creation path that relies solely on organization membership.
Proof of Concept
Tested on Gitea 1.23.7.
- Create an organization.
- Create a team with
can_create_org_repo=false. - Add a test user to that team.
- Verify that normal repository creation is denied:
POST /api/v1/orgs/target-org/repos
Result:
403 Forbidden
- Fork a repository into the organization:
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.
Impact
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.
Références
- https://github.com/advisories/GHSA-rjvx-x5h2-6px5
- https://github.com/go-gitea/gitea/security/advisories/GHSA-rjvx-x5h2-6px5
- https://github.com/go-gitea/gitea/pull/36950
- https://github.com/go-gitea/gitea/commit/686d10b7f0c26baf91171124b382cbcdfa7bf025
- https://github.com/go-gitea/gitea/releases/tag/v1.26.0
Vulnérabilités liées
Tout Supply chain →- MEDIUMCVE-2026-72792
SiYuan: Tag labels from password-protected documents are returned to readers who have not entered the password
- MEDIUMCVE-2026-63733
SurrealDB: Writes in a PERMISSIONS clause bypass table permissions
- HIGHGHSA-w8wf-3qvj-6xqf
OpenClaw Feishu permission tools could ignore per-account disablement
- HIGHGHSA-2q7j-2vhx-56g8
OpenClaw Feishu tools could ignore per-account disablement
- MEDIUMCVE-2026-56743
Cilium may unexpectedly allow ingress traffic from the local namespace when a Kubernetes NetworkPolicy is configured with an ipBlock match
- HIGHCVE-2026-73841
OpenChoreo: Cross-project command execution and wirelog view access via OpenChoreo openchoreo-api exec and wirelogs endpoints