/

CVE-2026-28740

Severity:

HIGH RISK

(7.1)

Broken Access Control (CWE-639) in Gitea LFS Reuse

CVE-2026-28740

Deferred

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-639, CWE-863

Impact:

Unauthorized Data Access

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Gitea allows Git LFS object reuse in a way that can improperly authorize access to private source objects for users who only have repository-level permissions.

Under certain conditions, users without Code-unit access may still reuse Large File Storage (LFS) objects, potentially exposing content that should remain restricted.

Affected context

This vulnerability affects Gitea instances where Git LFS is enabled and object reuse is allowed across different authorization scopes.

It is most relevant in deployments that distinguish between general repository access and more restrictive Code-unit access, using these tiers to protect certain objects or content within a project.

The issue appears when LFS objects associated with private or otherwise restricted code can be referenced or reused by users who have repository access but are not intended to see specific code units.

Exploit preconditions

  • Attack surface: Gitea Git LFS endpoints and workflows that support LFS object upload, download, or reuse.
  • Required access: Valid user account with access to the target repository but without Code-unit level permissions.
  • Trigger point: Operations that reference or reuse existing LFS objects (e.g., pushing, pulling, or re-linking LFS content) without re-enforcing finer-grained access checks.
  • Why exploitation is possible: Authorization for LFS object reuse is tied to repository-level access rather than the more specific Code-unit authorization, allowing users to benefit from previously authorized LFS objects they should not individually access.

Why this happens

The root cause is insufficient authorization checks when handling Git LFS object reuse in Gitea.

The system enforces repository-level permissions but fails to consistently validate whether the requesting user has the appropriate Code-unit access for the underlying source object being reused.

This maps to CWE-639: Authorization Bypass Through User-Controlled Key and CWE-863: Incorrect Authorization, because the authorization logic assumes that repository access is sufficient, and does not properly bind LFS objects to the stricter permissions required for specific code units.

Potential impact

  • Unauthorized users may access or reuse LFS objects tied to private or restricted code units.
  • Sensitive content stored as LFS objects could be exposed to users who should only have limited repository visibility.
  • Internal or proprietary assets embedded in LFS may be unintentionally disclosed.
  • Access control policies relying on Code-unit permissions can be undermined, leading to broader data governance issues.

General mitigation guidance

Mitigation generally focuses on tightening authorization boundaries between repository-level access and finer-grained content permissions.

Useful patterns include:

  • Ensuring that access checks for LFS object download and reuse apply the same authorization model as the protected source code or Code units.
  • Treating LFS objects as protected resources that inherit the most restrictive permissions of the content they represent.
  • Reducing reliance on implicit trust in repository membership for sensitive artifacts and explicitly modeling Code-unit–level permissions in storage and retrieval paths.
  • Applying the principle of least privilege by minimizing which roles may interact with shared or reusable LFS objects, especially in multi-tenant or multi-role projects.

How teams detect issues like this

Detection can focus on both code and behavior:

  • Static and code review: Look for authorization logic where LFS object access is only checked against repository-level permissions without verifying the underlying Code-unit authorization.
  • Policy enforcement: Define security requirements that all storage backends (including LFS) must respect the highest applicable permission level for associated content.
  • Runtime monitoring: Analyze access logs for patterns where users without Code-unit access are repeatedly retrieving or reusing LFS objects tied to restricted branches, files, or modules.
  • Automated review tools and linters can be configured to flag endpoints or services where access decisions are based solely on coarse-grained repository roles.

Sources

SourceLink
blog.gitea.comblog.gitea.com/release-of-1.26.3-and-1.26.4/
github.comgithub.com/go-gitea/gitea/pull/38050
github.comgithub.com/go-gitea/gitea/releases/tag/v1.26.3
github.comgithub.com/go-gitea/gitea/security/advisories/GHSA-2m9v-5q2g-58vq

Frequently asked

questions

Yes, it can be exploited remotely by authenticated users who interact with Gitea over standard Git and Git LFS protocols, provided they meet the repository-level access requirements.

The attacker typically needs valid credentials and repository access, but does not require the more restrictive Code-unit permissions that should guard specific LFS-backed content.

Align LFS object authorization with the same fine-grained access controls used for code and Code units, ensuring that any operation involving LFS objects re-validates the user's entitlement to the underlying content.

Design access control so that all storage layers (files, blobs, LFS objects) consistently enforce the most restrictive applicable permissions, and routinely review authorization paths for mismatches between coarse-grained and fine-grained controls.

Find out what's already
exploitable in your codebase.