Skip to content

fix(lfs): require proof of possession for cross-repo objects#38322

Open
bircni wants to merge 1 commit into
go-gitea:mainfrom
bircni:fix/lfs-cross-repo-object-linking
Open

fix(lfs): require proof of possession for cross-repo objects#38322
bircni wants to merge 1 commit into
go-gitea:mainfrom
bircni:fix/lfs-cross-repo-object-linking

Conversation

@bircni

@bircni bircni commented Jul 3, 2026

Copy link
Copy Markdown
Member

The LFS batch and upload handlers linked an object that already existed in the content store but was not linked to the current repo whenever the token's user could access it in another repo. Deploy-key tokens carry the repo owner's identity, so a single-repo write deploy key could link and then download objects from any repo the owner can see.

This drops the cross-repo access check: the batch handler now makes the client upload (hash-verified) any object not yet linked to the repo, and the upload handler skips proof of possession only when the object is already linked to the current repo.

The LFS batch and upload handlers linked an object that already existed
in the content store but was not linked to the current repo whenever the
token's user could access it in any other repo. Because deploy-key tokens
carry the repo owner's identity, a single-repo write deploy key could
link and then download objects from any repo the owner can see.

Stop using the cross-repo access check: the batch handler now requires
the client to upload (hash-verified) any object not yet linked to the
repo, and the upload handler skips proof of possession only when the
object is already linked to the current repo.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 3, 2026
@bircni bircni added the backport/v1.27 This PR should be backported to Gitea 1.27 label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/v1.27 This PR should be backported to Gitea 1.27 lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants