Every CVESearch/Get API key

GHSA-rjvx-x5h2-6px5

Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions

5.3 MediumFix available

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.

  1. Create an organization.
  2. Create a team with can_create_org_repo=false.
  3. Add a test user to that team.
  4. Verify that normal repository creation is denied:
POST /api/v1/orgs/target-org/repos

Result:

403 Forbidden
  1. 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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
Low
Availability
None

What each source reports

GitHub Advisories Score used5.3

Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions

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.

  1. Create an organization.
  2. Create a team with can_create_org_repo=false.
  3. Add a test user to that team.
  4. Verify that normal repository creation is denied:
POST /api/v1/orgs/target-org/repos

Result:

403 Forbidden
  1. 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.

Record
GHSA-rjvx-x5h2-6px5
CVSS 4.0
5.3 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-863
Updated
2026-11-02
OSV5.3

Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions

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.

  1. Create an organization.
  2. Create a team with can_create_org_repo=false.
  3. Add a test user to that team.
  4. Verify that normal repository creation is denied:
POST /api/v1/orgs/target-org/repos

Result:

403 Forbidden
  1. 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.

Record
GHSA-rjvx-x5h2-6px5
CVSS 4.0
5.3 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-863
Updated
2026-11-02
OSVGO-2026-6074No score

Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions in code.gitea.io/gitea

Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions in code.gitea.io/gitea

Record
GO-2026-6074
Updated
2026-11-02

Affected packages

Affected packages
PackageAffectedFixed
code.gitea.io/gitea
Go
before 1.26.0
1.26.0

History

History
RecordedChangedSources
first indexedGitHub Advisories, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

GHSA-rjvx-x5h2-6px5 is a medium vulnerability (CVSS 5.3) in code.gitea.io/gitea, published July 21, 2026. No source lists public exploit code. Fixed in code.gitea.io/gitea 1.26.0.

References

MoveEnter Open