CVE-2026-118395

Gitea public-only token bypass in repository and organization creation

Published Nov 1, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
Gitea 1.27.3 stopped personal access tokens restricted to public resources (`public-only`) from creating repositories through `POST /api/v1/user/repos` and `POST /api/v1/repos/migrate`, but `POST /api/v1/org/{org}/repos`, `POST /api/v1/orgs/{org}/repos`, `POST /api/v1/orgs` and `POST /api/v1/repos/{owner}/{repo}/generate` still accepted such tokens. A holder of a public-only token with the needed write scopes could create private repositories in organizations where the token's owner may create repositories, create private organizations, and generate private repositories from templates. The token still could not read the private repositories it created.

Analysis

AI-generated

Technical impact

A public‑only personal access token that normally is restricted to read‑only access to public resources can be used to create private repositories in organizations, create private organizations, and generate private repositories from templates. Because the target API endpoints failed to enforce the public‑only scope, an attacker with a legitimate public‑only token that also has write permissions can create resources beyond the token owner’s intended limits. This flaw is an instance of improper access control (CWE‑284), allowing a user to bypass the intended restrictive authorization model and gain privilege escalation opportunities.

Affected Systems

The vulnerability affects Gitea, specifically versions up to and including 1.27.3. The fix was backported to the 28.3.0 release. Administrators should verify that the installed Gitea instance is not running a pre‑28.3.0 version.

Risk and Exploitability

The risk is high because the attacker only needs a legitimate public‑only token with write permissions, which is a credential that an organization may legitimately hand out for automated tasks. The attack vector is through the public API endpoints for repository and organization creation, and it can be executed remotely without additional privileges. The EPSS score of < 1% indicates a very low, but non‑zero, likelihood of exploitation, while the CVSS score of 7.5 classifies the vulnerability as high severity. The lack of scope enforcement creates a serious privilege escalation vector. Administrators should treat this as a critical issue.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Gitea to version 28.3.0 or later to remove the scope bypass on affected endpoints.
  • Regenerate personal access tokens for automated tasks, ensuring they do not include write scopes for organization repository creation.
  • Audit existing private repositories and organizations that were created by public‑only tokens and adjust permissions or revoke tokens as necessary.

Generated by OpenCVE AI on November 6, 2026 at 19:28 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-285
Type Values Removed Values Added
Weaknesses CWE-284
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Type Values Removed Values Added
Weaknesses CWE-285
Type Values Removed Values Added
First Time appeared Gitea
Gitea gitea
Vendors & Products Gitea
Gitea gitea
Type Values Removed Values Added
Description Gitea 1.27.3 stopped personal access tokens restricted to public resources (`public-only`) from creating repositories through `POST /api/v1/user/repos` and `POST /api/v1/repos/migrate`, but `POST /api/v1/org/{org}/repos`, `POST /api/v1/orgs/{org}/repos`, `POST /api/v1/orgs` and `POST /api/v1/repos/{owner}/{repo}/generate` still accepted such tokens. A holder of a public-only token with the needed write scopes could create private repositories in organizations where the token's owner may create repositories, create private organizations, and generate private repositories from templates. The token still could not read the private repositories it created.
Title Gitea public-only token bypass in repository and organization creation
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Gitea
Published
Updated
Nov 6, 2026, 3:19 PM
Reserved
Nov 1, 2026, 8:50 AM
Status
Deferred
Published
Nov 1, 2026, 10:18 AM
Modified
Nov 6, 2026, 4:17 PM