ghtier

These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.

← All incidents

Heroku / Travis CI OAuth token theft

April 2022 · Contained

OAuth tokens stolen from Heroku, and tokens of the Travis CI app, let the attacker clone private repositories of dozens of organizations, npm among them, without ever breaking into GitHub.

Access held
T0repoHeroku machine tokenAWS access key
Full summary

The attacker never broke into GitHub. They broke into Heroku. A token for a Heroku machine account was sitting in an archived private Heroku repository, which Heroku believes was read through a third-party integration it could never name. With that token the attacker got into a Heroku database on 7 April 2022 and downloaded the GitHub OAuth tokens Heroku stored for every customer who had connected the Heroku Dashboard to GitHub. Tokens issued to the Travis CI OAuth app were also used; how they were taken is not stated. On 8 April the attacker used the tokens against the GitHub API to list each user's organizations and private repositories, picked targets, and from 9 April cloned private repositories of dozens of organizations, Heroku and npm among them. One npm repository held an AWS key. On 12 April GitHub caught that key being used against npm's production infrastructure, which is how the whole campaign came to light. GitHub believes the attacker was mining the cloned code for secrets to reach other systems.

How it unfolded

Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.

Whole path

Clone private repos with astolen tokentechniqueHeroku machine tokenArchived Heroku repoCompromised GitHub App orOAuth integrationway inrepoHeroku users' tokensrepoTravis CI user tokensClone private repos with astolen tokentechniqueAWS access keynpm's private repo

The whole attack, one row per step. Pick a step on the left, or click a box in its row.

Frameworks

Contained. First seen April 2022. Mapping by ghtier, not yet reviewed. Threat landscape

Sources