Details have emerged about the attack on the infrastructure used in the development of the PyTorch machine learning framework, which allowed the extraction of access keys sufficient to deploy arbitrary data in the project's release repository on GitHub and AWS, as well as to inject code into the main branch of the repository and add a backdoor through dependencies. The substitution of PyTorch releases could have been used to launch attacks on major companies such as Google, Meta, Boeing, and Lockheed Martin, which utilize 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 servrar continuous integration systems that perform rebuilds and execute tasks for testing new changes sent to the repository. The issue affects projects that use self-hosted external handlers, "Self-Hosted Runner," with GitHub Actions. Unlike traditional GitHub Actions, Self-Hosted handlers are not executed in GitHub's infrastructure but on their own servers or in virtual machines managed by the developers.
Executing build tasks on one's own servers allows for the launching of code that can scan the enterprise's internal network, search the local filesystem for encryption keys and access tokens, and analyze environment variables with parameters for accessing external storage or cloud services. Without proper isolation of the build environment, any confidential data found can be sent to the attacker externally, for example, through calls to external APIs. To determine the use of "Self-Hosted Runner" by projects, the Gato toolkit can be used, analyzing public workflow files and logs of CI job executions.
I PyTorch och mÄnga andra projekt som anvÀnder "Self-Hosted Runner" Àr det endast utvecklare vars Àndringar tidigare har granskats och inkluderats i projektets kodbas som har tillÄtelse att starta bygguppgifter. Att ha status som "contributor" nÀr man anvÀnder standardinstÀllningarna i ett repository ger möjlighet att köra GitHub Actions-handledare nÀr pull-begÀrningar skickas och dÀrmed köra sin kod i vilken GitHub Actions Runner-miljö som helst som Àr kopplad till repositoryt eller den organisation som projektet övervakar.
Bindningen till statusen "contributor" visade sig vara lĂ€tt att kringgĂ„ â det rĂ€ckte med att tidigare skicka en obetydlig Ă€ndring och vĂ€nta pĂ„ att den skulle godkĂ€nnas i kodbasen, vartill utvecklaren automatiskt fick status som aktiv deltagare vars pull-begĂ€rningar fĂ„r testas i CI-infrastrukturen utan sĂ€rskild granskning. För att fĂ„ status som aktiv utvecklare under experimentet anvĂ€ndes obetydliga kosmetiska Ă€ndringar kopplade till korrigeringar av typografiska fel i dokumentationen. För att fĂ„ Ă„tkomst till PyTorch-repositoryt och release-lagringen under attacken, genom att köra kod i "Self-Hosted Runner", genomfördes en avlyssning av en GitHub-token som anvĂ€ndes för att fĂ„ Ă„tkomst till repositoryt frĂ„n byggprocesserna, liksom AWS-nycklar som anvĂ€ndes för att spara byggresultat.
Problemet Àr inte specifikt för PyTorch och berör mÄnga andra större projekt som anvÀnder standardinstÀllningarna för "Self-Hosted Runner" i GitHub Actions. Till exempel har liknande attacker nÀmnts för att infoga bakdörrar i nÄgra stora kryptovaluta-plÄnböcker och blockchain-projekt med miljardkapitalisering, för att göra Àndringar i Microsoft Deepspeed och TensorFlow-releaser, för att kompromettera en av CloudFlare-företagets applikationer, samt för att köra kod pÄ datorer inom Microsofts nÀtverk. Detaljer kring dessa incidenter har Ànnu inte offentliggjorts. Inom ramen för de aktiva Bug Bounty-programmen har forskare skickat mer Àn 20 ansökningar för att fÄ belöning pÄ sammanlagt flera hundra tusen dollar.
KĂ€lla: opennet.ru
