# Self-hosted runner takeovers (PyTorch and others)

incident, `incident:self-hosted-runner-attacks`. Page: https://ghtier.com/incidents/self-hosted-runner-attacks

By fixing a typo to become a contributor, researchers got their pull requests to run without approval on non-ephemeral self-hosted runners of GitHub's runner-images, PyTorch and TensorFlow, stayed on the machines, and took the write tokens, PATs and cloud keys of the release jobs that ran there next.

**Abused:** [Contents: Write (repository)](https://ghtier.com/tier/permissions/contents-write.md) (Tier 2)

**Used:** [Read secrets from the runner](https://ghtier.com/attack-paths/technique-runner-memory.md) (Tier 2), [Backdoor a persistent self-hosted runner](https://ghtier.com/attack-paths/technique-runner-backdoor.md) (Tier 1), [Take the workflow token from a runner](https://ghtier.com/attack-paths/escalation-runner-code-to-token.md) (Tier 2), [Persist on a non-ephemeral self-hosted runner](https://ghtier.com/attack-paths/escalation-fork-pr-to-runner.md) (Tier 2)

**Sources:**
- [One supply chain attack to rule them all](https://adnanthekhan.com/2023/12/20/one-supply-chain-attack-to-rule-them-all/)
- [TensorFlow supply chain compromise via self-hosted runner attack](https://www.praetorian.com/blog/tensorflow-supply-chain-compromise-via-self-hosted-runner-attack/)
- [PyTorch supply chain compromise](https://www.stepsecurity.io/blog/pytorch-supply-chain-compromise)
- [GitHub, PyTorch and more orgs vulnerable to self-hosted runner attacks](https://www.legitsecurity.com/blog/github-pytorch-and-more-organizations-found-vulnerable-to-self-hosted-runner-attacks)
- [PyTorch GitHub misconfiguration (Wiz cloud threat landscape)](https://threats.wiz.io/all-incidents/pytorch-github-misconfiguration)
- [TensorFlow GitHub misconfiguration (Wiz cloud threat landscape)](https://threats.wiz.io/all-incidents/tensorflow-github-misconfiguration)

From ghtier (https://ghtier.com). Every entry and link: https://ghtier.com/data/graph.json. Tiers: https://ghtier.com/tier.
