Gitea: Git LFS object reuse allows non-Code access to authorize private source objects
A user with Code write access to one repository may be able to associate an existing Git LFS object from a private source repository with their target repository, even when they do not have Code access to the source repository that currently owns the LFS object.
The issue appears to be caused by the source-object authorization check using broad repository accessibility instead of requiring Code-unit access to at least one repository that owns the requested LFS object.
This issue breaks the expected authorization boundary between repository units.
A user who does not have Code access to a private source repository should not be able to reuse or associate Git LFS objects owned by that repository. However, because the source-object accessibility check accepts broad repository access, non-Code access such as Issues access may be sufficient for the LFS object to be treated as accessible.
If the reused object becomes downloadable through the attacker-controlled target repository after metadata association, this can result in cross-repository Git LFS content disclosure.
The target repository write authorization is still enforced. The problem is specifically in the authorization decision for whether the source LFS object is accessible and may be reused.
The attacker needs:
The issue affects the Git LFS upload/object reuse path.
Relevant paths:
```text
services/lfs/server.go
```
Relevant handlers:
```text
BatchHandler
UploadHandler
```
Both paths can call:
```go
git_model.LFSObjectAccessible(ctx, ctx.Doer, p.Oid)
```
The helper is located in:
```text
models/git/lfs.go
```
The authorization check uses:
```go
repo_model.AccessibleRepositoryCondition(user, unit.TypeInvalid)
```
When unit.TypeInvalid is used, the repository access condition can include broad repository access, such as organization team membership through team_repo and team_user, without requiring that the user has access to the Code unit of the source repository.
By contrast, Code-specific repository access checks use a concrete unit type and include team_unit validation.
I reproduced this locally using Gitea's Go test harness.
Validated against commit:
```text
dac41a124fd34820a3c8caf3b3592ba62cd514ff
```
The PoC creates the following scenario:
1. The attacker has Code write access to the target repository.
2. The source repository is private.
3. The attacker does not have Code access to the source repository.
4. The attacker only has Issues access to the source repository through an organization team.
5. An LFS object exists in the source repository.
6. LFSObjectAccessible(ctx, attacker, oid) returns true.
7. NewLFSMetaObject(ctx, targetRepo.ID, pointer) successfully creates LFS metadata for the target repository.
Test result:
```text
=== RUN TestLFSObjectAccessibleAllowsNonCodeSourceAccess
--- PASS: TestLFSObjectAccessibleAllowsNonCodeSourceAccess
PASS
ok gitea.dev/models/git
```
No live instance was tested. Validation was performed only against a local test database.
A user should not be allowed to reuse or associate an LFS object from a private source repository unless they have Code access to that source repository, or another permission level explicitly intended to grant access to repository file contents.
Non-Code permissions such as Issues access should not authorize access to Git LFS object content or allow Git LFS object reuse.
LFSObjectAccessible should require Code-unit access to at least one repository that owns the requested LFS object.
The check should avoid using unit.TypeInvalid for this source-object authorization decision. A Code-specific repository access condition should be used instead.
A regression test should cover:
Suggested severity: Medium to High.
The severity depends on whether the associated LFS object becomes downloadable through the target repository after reuse.
If the object becomes downloadable through the target repository, the issue should be considered High because it can lead to cross-repository Git LFS content disclosure.
Suggested CVSS v3.1 if content disclosure is confirmed:
```text
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N
```
Rationale:
This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity low, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N
CVE-2026-28740 is recorded against 3 packages.
Published on 22 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
github.com (Advisory)
nvd.nist.gov (Advisory)
blog.gitea.com (Web)
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Web)
code.gitea.io/gitea has other advisories on record. If you are patching this one, these are worth checking on the same host:
Details
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| code.gitea.io/gitea | — | — |
| gitea.dev | — | — |
| unknown | — | — |
References
Similar Threats
Site Security Check
CVE-2026-28740 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.