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

ArtiPACKED artifact token leakage

August 2024 · Ongoing

Public workflow artifacts in projects of Red Hat, Google, AWS, Microsoft, OWASP and others contained the job's own GitHub token, and Unit 42 showed it could download one and push with it before the job ended, or use a six-hour runtime token to swap an artifact.

Access held
T2Contents: WriteReplace the run's artifacts
Full summary

actions/checkout writes the workflow's GITHUB_TOKEN into the local git configuration by default so later steps can run git commands. Workflows that uploaded their whole checkout directory as an artifact, or uploaded super-linter's log with CREATE_LOG_FILE on, published that token with the artifact, readable by anyone on a public repository. Unit 42's Yaron Avital found such artifacts in well-known projects of Red Hat, Google, AWS, Canonical, Microsoft and OWASP, among others. A GITHUB_TOKEN expires when its job ends, so most were already dead by the time they could be downloaded. But upload-artifact v4 makes an artifact downloadable while the job is still running, and where steps followed the upload there was a race to win: Avital took a token from Red Hat's clair project and used it to create a branch before it expired. Some artifacts also held ACTIONS_RUNTIME_TOKEN, which lives about six hours and can replace a run's artifacts, so a later job or a user downloading them gets the attacker's file. super-linter stopped writing environment variables to its log after the report.

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

Take the workflow tokenfrom a runnerescalationContents: WriteThe job's workflow tokenPush directly, withoutreviewtechniqueSubmit malicious codeLeaked tokenway inReplace the run's artifactsRuntime token, ~6 hours

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

Frameworks

Ongoing. First seen August 2024. Mapping by ghtier, not yet reviewed. Threat landscape

Sources

Reported by: Unit42