Vulnerability Database

362,873

Total vulnerabilities in the database

CVE-2026-58431 — gitea.dev

Incorrect Authorization

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:

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:

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

They do not call:

ctx.TokenCanAccessRepo(repo)

The team activity feed handler also sets:

IncludePrivate: true

but does not apply:

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.

CVSS v3:

  • Severity: Low
  • Score: 4.3
  • AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

CWEs:

Frequently Asked Questions

A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.

CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.

A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.

Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.

Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.

SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.