Skip to main content

Gitea EUVDEUVD-2026-58158

| CVE-2026-58431 MEDIUM
Incorrect Authorization (CWE-863)
2026-07-21 https://github.com/go-gitea/gitea GHSA-h56g-4qw7-2mxg
4.3
CVSS 3.1 · Vendor: https://github.com/go-gitea/gitea
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to Gitea as team member
  2. Delivery
    Create or obtain public-only org-scoped token
  3. Exploit
    Send GET request to /api/v1/teams/{id}/repos
  4. Execution
    Bypass public-only middleware due to nil org context
  5. Impact
    Receive private repository metadata in API response

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization logic validation
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concurrent conditions: (1) the attacker must be an authenticated Gitea user who is a member of at least one team within a private organization, (2) that user must possess a public-only organization-scoped API token (a deliberate security-scoping feature available in Gitea's token management UI), and (3) the targeted organization must contain private repositories or private activity entries. The bypass occurs specifically because the team route group does not load ctx.Org.Organization, causing the checkTokenPublicOnly middleware to silently skip the visibility check. Exploitation is limited to information disclosure of repository metadata and activity feed data - repository content (code, commits, files) is not directly exposed by these endpoints. No network-level preconditions beyond standard HTTPS API access to the Gitea instance.

Impact

The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N scores 4.3 (Medium), which accurately reflects the bounded scope of impact: only metadata (repository names, activity feed entries) is disclosed, not repository content or credentials. PR:L confirms exploitation requires an authenticated session - the attacker must be a legitimate team member who possesses or obtains a public-only token. AC:L indicates no special timing or race condition is needed. No EPSS score is available in the provided data; given the authenticated prerequisite and metadata-only disclosure, real-world exploitation probability is likely low to moderate. No CISA KEV listing exists, but a working PoC has been publicly verified against the latest release (1.26.2), which meaningfully raises exploitability compared to theoretical vulnerabilities. The principal risk scenario is an insider or compromised account using a deliberately scoped (public-only) token to enumerate private organizational structure - useful for reconnaissance but not for direct code theft. No conflicting signals between CVSS vector and description; both consistently indicate network-accessible, low-complexity, authenticated read-only access.

Exploit ScenarioDerived

A developer or CI/CD service account holds a public-only organization-scoped Gitea API token intended to limit access to public resources. By sending authenticated GET requests to /api/v1/teams/{teamid}/repos or the team activity feed endpoint with this token, the attacker retrieves private repository names and organizational activity entries that should be hidden. A working PoC has been publicly verified against Gitea 1.26.2, meaning exploitation requires only a valid public-only token and knowledge of a team ID reachable by that token.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 22, 2026

Incorrect authorization enforcement in Gitea's team API routes exposes private repository metadata and activity feed entries to public-only access tokens. Affected versions through 1.26.2 allow an authenticated team member holding a public-only scoped token to bypass the intended access restriction and retrieve private team repository listings and private activity feed data via /api/v1/teams/{id} endpoints. Publicly available exploit code (PoC) has been verified against Gitea 1.26.2 and nightly builds; no KEV listing at time of analysis. EPSS data not provided, but the CVSS score of 4.3 and limited confidentiality impact (metadata only, no code exfiltration) suggest moderate real-world risk.

RemediationAI

Upgrade to Gitea v1.27.0 or later, which resolves the authorization bypass by correctly loading ctx.Org.Organization in team API routes and applying ctx.TokenCanAccessRepo(repo) filtering and opts.ApplyPublicOnly(ctx.PublicOnly) to team repository and activity feed handlers respectively. The release is available at https://github.com/go-gitea/gitea/releases/tag/v1.27.0. If immediate upgrade is not possible, a compensating control is to revoke all public-only organization-scoped tokens and restrict API token creation until the patch is applied - this removes the precondition for exploitation but also disrupts legitimate public-only API integrations. Alternatively, network-level ACLs can restrict /api/v1/teams/* endpoints to trusted internal IP ranges, though this may impact legitimate external integrations. The GitHub Security Advisory is at https://github.com/go-gitea/gitea/security/advisories/GHSA-h56g-4qw7-2mxg.

Affected VersionsENISA

Gitea Open Source Git Server 0 ≤1.26.4

Affected Packages

go gitea.dev fix: 1.27.0
euvd gitea_open_source_git_server no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Gitea is a self-hosted Git service written in Go. The affected component is the team API route group at /api/v1/teams/{teamid}, which uses orgAssignment(false, true) - this loads ctx.Org.Team but intentionally does not load ctx.Org.Organization. The checkTokenPublicOnly middleware enforces the public-only token restriction by checking organization visibility through ctx.Org.Organization; when that value is nil (as it is for team routes), the visibility check silently passes - a classic nil-dereference bypass pattern. Additionally, team repository handlers invoke repo_model.GetTeamRepositories() and convert.ToRepo() without calling ctx.TokenCanAccessRepo(repo), bypassing per-repository public-only filtering. The team activity feed handler explicitly sets IncludePrivate: true without applying opts.ApplyPublicOnly(ctx.PublicOnly). The root cause class is CWE-863 (Incorrect Authorization) - the authorization logic is present but fails to execute due to missing context initialization on the team route group. Affected package: pkg:go/gitea.dev versions prior to 1.27.0.

Know when Gitea gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/go-gitea/gitea) PRIMARY 4.3 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
vuln.today AI 4.3 MEDIUM

Network-accessible API requiring authenticated team membership (PR:L); metadata-only disclosure drives C:L with no integrity or availability impact.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM

Primary rating from Vendor (https://github.com/go-gitea/gitea).

CVSS VectorVendor: https://github.com/go-gitea/gitea

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

DescriptionCVE.org

Summary

Gitea's /api/v1/teams/{id} API routes do not correctly enforce the public-only access token restriction.

A public-only token is intended to limit API access to public repositories and public organizations. However, several team API routes continue to return private team repository metadata and private team activity feed entries when called with a public-only token.

Details

The /api/v1/teams/{teamid} route group uses:

go
orgAssignment(false, true)

This loads ctx.Org.Team, but does not load ctx.Org.Organization.

The checkTokenPublicOnly middleware checks organization visibility through ctx.Org.Organization. When ctx.Org.Organization is nil, the organization visibility check silently passes.

In addition, the team repository handlers return repositories without applying repository-level public-only filtering:

go
repo_model.GetTeamRepositories(...)
convert.ToRepo(...)

They do not call:

go
ctx.TokenCanAccessRepo(repo)

The team activity feed handler also sets:

go
IncludePrivate: true

but does not apply:

go
opts.ApplyPublicOnly(ctx.PublicOnly)

PoC

Vulnerability is verified on latest gitea release (1.26.2) and nightly build. Frist, create a public-only organization-scoped token for a user who is a member of a team in a private org with private repositories:

<img width="1075" height="577" alt="image" src="https://github.com/user-attachments/assets/4a01d0ab-f67c-47c9-94b1-e74ddd77d7bc" />

<img width="649" height="375" alt="image" src="https://github.com/user-attachments/assets/b5d91962-088e-40f4-bc51-88a17946e6d8" />

Use the returned token to request team repositories:

<img width="1728" height="190" alt="image" src="https://github.com/user-attachments/assets/0f15878f-5806-431d-958c-ffb39bf7c1e9" />

Expected result: Private repositories should be hidden or rejected for a public-only token. Actual result: Private team repository metadata is returned.

The team activity feed endpoint can be tested similarly:

<img width="1728" height="237" alt="image" src="https://github.com/user-attachments/assets/280a5ddf-ad14-4769-86a8-1fdad858287c" />

Impact

A public-only token can access private team resources that should be hidden from that token.

Threat Intelligence Overview

EPSS Score
0.1%
Top 96% exploitable
Prevalence
Medium
popular self-hosted Git service, common in developer and DevOps environments
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

22
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +22
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in Gitea

View all
CVE-2026-60004 CRITICAL POC
9.8

Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi

CVE-2026-27771 HIGH POC
8.2 Jul 03

Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r

CVE-2022-30781 HIGH POC
7.5 May 16

Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp

CVE-2020-14144 HIGH POC
7.2 Oct 16

The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir

CVE-2024-6886 CRITICAL POC
10.0 Aug 06

Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea

CVE-2026-72867 CRITICAL POC
9.9 Aug 10

Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us

CVE-2026-20896 CRITICAL POC
9.8 Jul 03

Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any

CVE-2026-59774 CRITICAL POC
9.8

Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by

CVE-2026-58053 CRITICAL POC
9.4 Jun 28

Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec

CVE-2019-11229 HIGH POC
8.8 Apr 15

models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem

CVE-2026-57894 HIGH POC
8.5 Jul 21

Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica

CVE-2026-24791 HIGH POC
8.1 Jun 17

Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy