The vulnerability exists in Gitea's web archive download functionality. The endpoints responsible for downloading repository archives, specifically /archive/*, did not properly validate the scope of the OAuth2 token being used for authentication. This allowed a user with a token that had any scope, even non-repository related ones like read:issue, to download the full archive of any private repository they had access to. The root cause was the absence of a token scope check in the Download and InitiateDownload functions located in routers/web/repo/repo.go. The vulnerability was fixed by adding a call to the checkDownloadTokenScope function at the beginning of both of these functions, ensuring that the token has the necessary repository scope before allowing the download to proceed. An exploit of this vulnerability would involve a call to either the Download or InitiateDownload function, which would appear in a runtime profile.