Raiders of the Lost Artifacts: Racing for Hidden Treasures in Public GitHub Repositories
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
IEEE Symposium on Security and Privacy·15 min
Presenters detail vulnerability discovery and exploitation in SoK: Taxonomy of Attacks on Open-Source Software Supply Chains.
Talks·18 min
Hilko Bengen
Shows how eBPF tracing of compiler and linker activity can expose hidden backdoors in software builds.
Talks·57 min
Alexis-Maurer Fortin
Shows how CI/CD workflows in open source projects leak secrets and can be hijacked through pull requests.


