ArtiPACKED: Hacking Giants Through a Race Condition in GitHub Actions Artifacts
GitHub Actions artifacts from public repositories could leak GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN due to misconfigurations like persisting credentials or logging environment variables. Attackers could download artifacts and use leaked tokens to push code or replace artifacts, potentially leading to remote code execution.
Published on unit42.paloaltonetworks.com
This research reviews an attack vector allowing the compromise of GitHub repositories, which not only has severe consequences in itself but could also potentially lead to high-level access to cloud environments. This is made possible through the abuse of GitHub Actions artifacts generated as part of organizations’…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the root cause is that GitHub Actions workflows inadvertently include sensitive tokens in artifacts due to default behaviors (like persisting credentials) and misconfigurations (like logging environment variables), and these artifacts are publicly accessible.
Impact
Attackers could push malicious code to repositories, potentially leading to remote code execution on runners or developer workstations, and could access secrets stored in the repository and organization.
What the attacker needed
Public repository with GitHub Actions; Workflow uploads artifact containing token; Attacker can download artifact
The fix
The issue should be fixed by avoiding uploading sensitive files as artifacts, using least privilege for tokens, and scanning artifacts for secrets before upload.
How it was found
- Wait for a pipeline to be triggered.
- The repository triggers a pipeline.
- The pipeline inadvertently uploads an artifact that includes the GITHUB_TOKEN.
- Before the workflow job finishes, an attacker downloads the publicly available artifact.
- The attacker extracts the token from the artifact and uses it to push malicious code to the repository.
- The pipeline job ends, and the GITHUB_TOKEN is invalidated.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When developers use GitHub Actions to build software, they often upload files called artifacts that can contain secret tokens. If these artifacts are public, anyone can download them and use the tokens to access the project, potentially changing code or stealing data.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.