Aanval op de infrastructuur van PyTorch, compromitterend de repository en releases

Details of the attack on the infrastructure used for the development of the machine learning framework PyTorch have been revealed, allowing access keys to be extracted, which are sufficient for placing arbitrary data in the project's release repository on GitHub and AWS, as well as for injecting code into the main branch of the repository and adding a backdoor through dependencies. The compromise of PyTorch releases could have been used to attack major companies like Google, Meta, Boeing, and Lockheed Martin, which use PyTorch in their projects. As part of the Bug Bounty program, Meta paid researchers $16,250 for information about the issue.

The essence of the attack lies in the ability to execute one's own code on servers continuous integration, which rebuilds and executes tasks for testing new changes sent to the repository. The problem affects projects that use their own external handlers 'Self-Hosted Runner' with GitHub Actions. Unlike traditional GitHub Actions, Self-Hosted runners run not in GitHub's infrastructure but on their own servers or in virtual machines, maintained by developers.

Executing build tasks on their servers allows for the execution of code that can scan the internal network of the enterprise, search in the local file system for encryption keys and access tokens, and analyze environment variables containing parameters for accessing external storage or cloud services. In the absence of proper isolation of the build environment, the found confidential data can be sent out by the attacker, for example, through calls to external APIs. To determine the use of 'Self-Hosted Runner' by projects, the Gato toolkit can be used, analyzing publicly available workflow files and logs of CI task runs.

In PyTorch and many other projects using 'Self-Hosted Runner', the launching of build tasks is permitted only for developers whose changes have previously been reviewed and included in the project's codebase. Having the 'contributor' status when using default settings in the repository allows for the execution of GitHub Actions handlers when submitting pull requests, thus enabling the execution of one's own code in any GitHub Actions Runner environment connected to the repository or the supervising project organization.

Het was gemakkelijk om de status 'contributor' te omzeilen - het was genoeg om een kleine wijziging te verzenden en deze in de codebase goed te keuren, waarna de ontwikkelaar automatisch de status van actieve deelnemer kreeg, wiens pull-requests getest mochten worden in de CI-infrastructuur zonder aparte controle. Voor het verkrijgen van de status van actieve ontwikkelaar werden tijdens het experiment kleine cosmetische wijzigingen aangebracht met betrekking tot het corrigeren van typfouten in de documentatie. Om toegang te krijgen tot de repository en de release-opslagplaats van PyTorch, werd er tijdens de aanval een onderschepping van de GitHub-token uitgevoerd, die werd gebruikt voor toegang tot de repository vanuit de buildprocessen, evenals AWS-sleutels die werden ingezet voor het opslaan van de buildresultaten.

Het probleem is niet specifiek voor PyTorch en raakt veel andere grote projecten die de standaardinstellingen voor de 'Self-Hosted Runner' in GitHub Actions gebruiken. Zo zijn er ook vergelijkbare aanvallen uitgevoerd om een backdoor in enkele grote cryptocurrency-portemonnees en blockchain-projecten met miljarden aan marktkapitalisatie te integreren, zijn er wijzigingen aangebracht in de releases van Microsoft Deepspeed en TensorFlow, is een van de applicaties van CloudFlare gecompromitteerd, en is er code uitgevoerd op een computer in het Microsoft-netwerk. De details van deze incidenten zijn voorlopig niet openbaar gemaakt. Onder de bestaande Bug Bounty-programma's hebben onderzoekers meer dan 20 aanvragen ingediend voor beloningen ter waarde van enkele honderdduizenden dollars.

Bron: opennet.ru

Koop betrouwbare webhosting met bescherming tegen DDoS, VPS VDS servers 🔥 Koop betrouwbare webhosting met bescherming tegen DDoS, VPS VDS servers | ProHoster