The vulnerability allows users who previously had access to a repository to continue receiving release notifications even after the repository is made private. This can lead to the disclosure of potentially sensitive information in the release titles and content.
The root cause of the vulnerability is twofold:
-
Failure to Clear Watches: When a repository is made private, the system did not clear the list of users who were 'watching' it. The repository.MakeRepoPrivate function in services/repository/repository.go was missing the logic to remove these watches.
-
Lack of Permission Checks: The mailer.MailNewRelease function in services/mailer/mail_release.go, which is responsible for sending release notifications, did not verify if the recipients still had access to the repository. It would send notifications to all watchers, including those who should no longer have access.
The patch addresses both of these issues. It modifies repository.MakeRepoPrivate to call a new function, ClearRepoWatches, which removes all watches from a repository when it is made private. Additionally, it updates mailer.MailNewRelease to include a permission check, ensuring that notifications are only sent to users who are authorized to view the release.