News for hackers. Stuff that matters.
Re:We Executed a Critical Supply Chain Attack on PyTorch by n2d4 on Sunday January 14, 2024 @04:39PM (#38994693)
Pytorch did use GH secrets for the valuables and you can see that this wasn't enough, right there in the OP, because the self-hosted runners are still shared
Re:We Executed a Critical Supply Chain Attack on PyTorch by adnanthekhan on Sunday January 14, 2024 @05:50PM (#38995257)
Yup! This is what makes this kind of attack scary and very unique to GitHub Actions. The baseline GITHUB_TOKEN just blows the door open on lateral movement via workflow_dispatch and and repository_dispatch events.

In several of our other operations, not just PyTorch, we leveraged workflow_dispatch to steal a PAT from another workflows. Developers tend to over-provision PATs so often. More often than not we'd end up with a PAT that has all scopes checked and org admin permissions. With that one could clean out all of the secrets from an organization in minutes using automated tools such as https://github.com/praetorian-inc/gato.

Re:We Executed a Critical Supply Chain Attack on PyTorch by trevyn on Sunday January 14, 2024 @06:23PM (#38995503)
To clarify, this secret stealing is not an issue with GitHub-hosted runners, correct?
Re:We Executed a Critical Supply Chain Attack on PyTorch by adnanthekhan on Sunday January 14, 2024 @06:43PM (#38995662)
Correct. For fork PR workflows on the pull_request trigger the GITHUB_TOKEN has read only permissions, so you can’t do anything with it.

The key thing with a non-ephemeral runner is that (after obtaining persistence) you can grab the GITHUB_TOKEN from a subsequent non-fork PR build or a build on another trigger, which will have write permissions unless restricted by the repository maintainers.

Re:We Executed a Critical Supply Chain Attack on PyTorch by lmeyerov on Monday January 15, 2024 @11:03AM (#39002325)
I think 'environments' was meant, where diff GHA environments get diff secrets, and policies dictate who gets to run what actions with what envs.

But that is real work to setup, audit, and maintain. It'd be better if, like phone app capabilities, the default would be no privs, any privs are explicitly granted, and if they aren't being used, the system detects that and asks if you want to remove specific ones.

Re:We Executed a Critical Supply Chain Attack on PyTorch by gabriel-samfia on Tuesday January 16, 2024 @07:40AM (#39012650)
Ouch! This is why ephemeral runners should be used. Preferably virtual machines. On an infrastructure that can define security group rules to prevent lateral movement.