# GHSA-rjvx-x5h2-6px5: Gitea: API Fork Endpoint Authorization Bypass Allows Organization Members to Bypass Repository Creation Restrictions

> Organization members with restricted permissions can bypass repository creation limits by using the API fork endpoint instead of the web UI.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Jul 2026
- **Also known as:** GO-2026-6074

## What is GHSA-rjvx-x5h2-6px5?

GHSA-rjvx-x5h2-6px5 is a missing authorization vulnerability in code.gitea.io/gitea, published on 21 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### 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:

```go
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:

```go
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:

```http
POST /api/v1/orgs/target-org/repos
```

Result:

```http
403 Forbidden
```

5. Fork a repository into the organization:

```http
POST /api/v1/repos/admin/public-repo/forks
Content-Type: application/json

{
  "organization": "target-org"
}
```

Result:

```http
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.

## Which versions are affected by GHSA-rjvx-x5h2-6px5?

3 open source packages ship an affected version, including code.gitea.io/gitea.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `code.gitea.io/gitea` | Go | All versions | 1.26.0 |
| `code.gitea.io/gitea` | Go | All versions | 1.26.0 |
| `code.gitea.io/gitea` | Go | All versions | 1.26.0 |

## How do I fix GHSA-rjvx-x5h2-6px5?

Upgrade code.gitea.io/gitea to 1.26.0 or later.

## Is GHSA-rjvx-x5h2-6px5 being exploited?

There is no known exploitation of GHSA-rjvx-x5h2-6px5 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-rjvx-x5h2-6px5 and fix it if it is affected.

What it is: GHSA-rjvx-x5h2-6px5 is a missing authorization vulnerability in code.gitea.io/gitea, published on 21 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-rjvx-x5h2-6px5 in the wild and no public exploit code.

Affected packages and fixed versions:
- code.gitea.io/gitea (Go): affected all versions; fixed in 1.26.0
- code.gitea.io/gitea (Go): affected all versions; fixed in 1.26.0
- code.gitea.io/gitea (Go): affected all versions; fixed in 1.26.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-rjvx-x5h2-6px5/ (Markdown: https://insights.sbomify.com/GHSA-rjvx-x5h2-6px5/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-rjvx-x5h2-6px5

---
From sbomify Insights: https://insights.sbomify.com/GHSA-rjvx-x5h2-6px5/
Summaries are generated and may contain mistakes; the official description above is the record.
