GitHub Breach Exposes Secrets of 23,000 Repositories

A massive GitHub supply chain attack has exposed secrets from over 23,000 repositories, marking one of the most significant security breaches in the history of open-source projects. The breach began with the theft of a Personal Access Token (PAT) from SpotBugs, a widely used tool for static code analysis, leading to unauthorized access and malicious modifications of sensitive data across numerous projects. This unprecedented attack highlights the critical vulnerabilities in automated workflows and underscores the necessity for robust security measures.

Initial Compromise and Cascade of Breaches

The timeline of the attack reveals that on November 28, 2024, the maintainer of SpotBugs unintentionally exposed their PAT. This exposure occurred when the maintainer used the token as a secret within a workflow in the spotbugs/sonar-findbugs repository. Capitalizing on this vulnerability, the attackers submitted a malicious pull request on December 6, 2024, leveraging the pull_request_target trigger. This trigger can grant workflows access to secrets from the original repository, enabling the attackers to initiate a poisoned pipeline execution attack. The compromised token facilitated unauthorized access to SpotBugs, setting off a series of lateral movements and subsequent breaches.

From SpotBugs, the attackers pivoted to other repositories, employing lateral movement tactics to expand their reach. Among the targeted repositories was reviewdog, a tool designed for integrating code reviews with various continuous integration (CI) systems. By exploiting reviewdog, the attackers gained deeper access and control, methodically advancing their malicious activities. The cascade of breaches underscores the interconnectedness of repository dependencies and the heightened risk when a single repository’s security is compromised.

Workflow Exploitations

A significant aspect of this supply chain attack was the exploitation of GitHub Actions workflows. GitHub Actions are used to automate tasks such as code reviews, testing, and project management within repositories. The attackers ingeniously leveraged SpotBugs’ workflow to initiate a chain reaction that impacted numerous repositories. By manipulating the workflows, they could inject malicious code and maneuver within the ecosystem, broadening the scope of their infiltration.

The exploitation of workflows is particularly concerning given their integral role in maintaining the efficiency and organization of development projects. The attackers’ use of GitHub Actions to embed code that leaks sensitive information into build logs demonstrates a sophisticated understanding of these automated processes. This method allowed them to surreptitiously harvest API keys, passwords, access tokens, and other sensitive data from the logs of continuous integration workflows, compromising the security of countless projects in the process.

Reviewdog and tj-actions/changed-files Compromises

Following the initial breach of SpotBugs, the attackers targeted reviewdog, a critical tool for integrating code review functionality with CI systems. With access to reviewdog, the attackers could manipulate various dependencies, including the reviewdog/action-setup repository. This repository serves as a dependency for tj-actions/eslint-changed-files, which, in turn, is a dependency for tj-actions/changed-files—a popular GitHub Action used by over 23,000 repositories to track file changes.

The compromise of tj-actions/changed-files allowed attackers to embed code that exfiltrated secrets from build logs. This tactic of embedding malicious code into workflows facilitated the stealthy extraction of sensitive data, such as API keys and access tokens, without raising immediate alarms. The far-reaching consequences of these compromises are profound, highlighting the chain reaction of vulnerabilities within interconnected repositories and the ease with which attackers can propagate their malicious activities across multiple projects.

Methodical Sneak By Attackers

The attackers employed sophisticated tactics to maintain obscurity and misdirect detection efforts. Despite their typically stealthy operational patterns, they inadvertently logged stolen secrets, which ultimately exposed their presence to researchers. The Unit 42 threat hunting team meticulously investigated the breach, piecing together the indicators of compromise and uncovering the intricate movements of the attackers.

Unit 42’s investigation revealed that the attackers had full control of the SpotBugs maintainer’s token, enabling them to create an account named jurkaofavak and add this account as a maintainer within the SpotBugs repository. This level of access allowed the attackers to further their malicious activities within the ecosystem. Furthermore, researchers Adnan Khan and Wiz pinpointed that the roots of the tampering traced back to reviewdog and its associated repositories, emphasizing the depth and complexity of the attack strategy.

Broad Implications and Security Vulnerabilities

The exposure of secrets from over 23,000 repositories due to this supply chain attack reflects critical vulnerabilities in GitHub Actions workflows and repository dependencies. The interconnected nature of these repositories means that a single compromised token can lead to widespread breaches, as evidenced by the cascading effects from SpotBugs to reviewdog and eventually to tj-actions/changed-files. The attack demonstrates the alarming ease with which sensitive data from myriad projects can be siphoned within a short period.

This breach underscores the necessity for reinforced security protocols concerning Personal Access Tokens (PAT) usage. Security professionals must emphasize the importance of safeguarding secrets and implementing stringent measures to detect and respond to suspicious activities. The investigation led by StepSecurity and Unit 42 highlights the need for heightened vigilance, robust incident response mechanisms, and proactive strategies to mitigate risks associated with automated workflows.

Ongoing Investigations and Future Mitigations

A massive security breach on GitHub has exposed secrets from over 23,000 repositories, representing one of the largest security incidents in the history of open-source projects. This breach originated from the theft of a Personal Access Token (PAT) associated with SpotBugs, a widely utilized tool for static code analysis. The stolen PAT enabled unauthorized access and malicious alterations to sensitive data across numerous projects.

This significant security violation underscores the inherent vulnerabilities within automated workflows, emphasizing the urgent need for enhanced security measures. This attack serves as a stark reminder of the relentless need to secure open-source development processes and prioritize robust security protocols. As open-source projects continue to be integral to the software industry, heightened awareness and proactive steps are essential to safeguarding against future threats and ensuring the integrity and safety of code and data.

Subscribe to our weekly news digest.

Join now and become a part of our fast-growing community.

Invalid Email Address
Thanks for Subscribing!
We'll be sending you our best soon!
Something went wrong, please try again later