GitHub Vulnerability ‘ArtiPACKED’ Exposes Repositories to Potential Takeover

Cyber Security

Aug 15, 2024Ravie LakshmananCloud Security / DevOps

A newly discovered attack vector in GitHub Actions artifacts dubbed ArtiPACKED could be exploited to take over repositories and gain access to organizations’ cloud environments.

“A combination of misconfigurations and security flaws can make artifacts leak tokens, both of third party cloud services and GitHub tokens, making them available for anyone with read access to the repository to consume,” Palo Alto Networks Unit 42 researcher Yaron Avital said in a report published this week.

“This allows malicious actors with access to these artifacts the potential of compromising the services to which these secrets grant access.”

Cybersecurity

The cybersecurity company said it primarily observed the leakage of GitHub tokens (e.g., GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN), which could not only give malicious actors unauthorized access to the repositories, but also grant them the ability to poison the source code and get it pushed to production via CI/CD workflows.

Artifacts in GitHub allow users to share data between jobs in a workflow and persist that information after it has been completed for 90 days. This can include builds, log files, core dumps, test outputs, and deployment packages.

The security problem here is that these artifacts are publicly available for anyone in the case of open-source projects, making them a valuable resource for extracting secrets like GitHub access tokens.

Particularly, the artifacts have been found to expose an undocumented environment variable called ACTIONS_RUNTIME_TOKEN, which has a lifespan of about six hours and could be used to substitute an artifact with a malicious version before it expires.

This could then open an attack window for remote code execution when developers directly download and execute the rogue artifact or there exists a subsequent workflow job that’s configured to run based on previously uploaded artifacts.

While GITHUB_TOKEN expires when the job ends, improvements made to the artifacts feature with version 4 meant that an attacker could exploit race condition scenarios to steal and use the token by downloading an artifact while a workflow run is in progress.

Cybersecurity

The pilfered token could be subsequently used to push malicious code to the repository by creating a new branch before the pipeline job ends and the token is invalidated. However, this attack banks on the workflow having the “contents: write” permission.

A number of open-source repositories related to Amazon Web Services (AWS), Google, Microsoft, Red Hat, and Ubuntu have been found susceptible to the attack. GitHub, for its part, has categorized the issue as informational, requiring that users take it upon themselves to secure their uploaded artifacts.

“GitHub’s deprecation of Artifacts V3 should prompt organizations using the artifacts mechanism to reevaluate the way they use it,” Avital said. “Overlooked elements like build artifacts often become prime targets for attackers.”

Found this article interesting? Follow us on Twitter and LinkedIn to read more exclusive content we post.

Products You May Like

Articles You May Like

DOJ Charges Nashville Man for Helping North Koreans Get U.S. Tech Jobs
Take-Two CEO Says Call of Duty Will Help Grow Xbox Game Pass ‘For a Period of Time’: Report
Apple’s Mac Computers Captured 60 Percent of AI PC Market, Windows AI PC Shipments Grew 12 Percent in Q2 2024: Canalys
OTT Releases This Week: Shekhar Home, Emily in Paris Season 4, Kaun Banega Crorepati Season 16, and More
Podcast: Japan’s quest for the most powerful microchip leads semiconductor revival

Leave a Reply

Your email address will not be published. Required fields are marked *