Skip to content

DEF CON 34 talks are here: 354 talks, summarized and searchable.

Browse DEF CON 34

Raiders of the Lost Artifacts: Racing for Hidden Treasures in Public GitHub Repositories

Yaron Avital

Supply ChainCommon Ground19 minIntermediateOpen on YouTube ↗

Where

Common Ground
BSides Las Vegas

Duration

19 min

Shows how leaked GitHub Actions tokens in public build artifacts can be stolen in a race before they expire.

Summary

The talk looks at GitHub Actions, the CI/CD platform that runs builds and tests for many open-source projects, and at build artifacts, which public repositories expose for anyone to download. The speaker scanned popular repositories' artifacts for secrets and found cloud keys, personal tokens and short-lived workflow tokens. Two patterns caused most leaks: a checkout action that stored credentials in the local git folder, which users then uploaded with the whole directory, and a linter that printed environment variables into logs that were also uploaded.

Workflow tokens expired when a job finished, so most could not be used to push code. A runtime token lasted about six hours, and by swapping an artifact for a malicious one, the speaker achieved code execution in any job that consumed it. A later artifact change made uploads visible immediately, opening a window of roughly two and a half seconds. The speaker built an automated tool that watched for pipeline runs, downloaded the new artifact, extracted the token and created a branch, running it from GitHub Actions to reduce latency. Live demos showed branches created in a container scanner and other widely used projects.

The main takeaways are to restrict workflow permissions and to scan artifacts for secrets before upload. The speaker released an action that blocks uploads containing secrets and fails the pipeline. GitHub's response placed responsibility on users to avoid uploading secrets.

Related talks