The vulnerability is an improper access control issue in Gitea's Git LFS lock management. The root cause is the git.GetLFSLockByID function, which fetched LFS locks using only the lock's ID, without validating which repository the lock belongs to. This insecure function was used by the git.DeleteLFSLockByID function, which is exposed via an API endpoint. An attacker with write permissions in any repository could send a request to this endpoint with the ID of an LFS lock from a different repository. The backend would fetch and delete the lock without verifying that it belonged to the repository the user was authorized to access. The patch rectifies this by introducing a new function, git.GetLFSLockByIDAndRepo, which requires both the lock ID and the repository ID, ensuring that operations are confined to the correct repository. The calling functions, git.DeleteLFSLockByID and lfs.GetListLockHandler, were updated to use this new secure function.