GhostAction Campaign Targets GitHub to Steal Cloud Secrets

GhostAction Campaign Targets GitHub to Steal Cloud Secrets

The digital infrastructure of the modern era relies heavily on the implicit trust established within open-source communities, yet the GhostAction campaign has demonstrated how easily this foundation can be shattered by a determined and automated adversary. By focusing on the GitHub ecosystem, threat actors have moved beyond simple phishing and have instead targeted the sophisticated CI/CD pipelines that power global software development. This campaign represents a professionalized shift in cybercrime, where the objective is no longer just to deface a website but to systematically harvest the cryptographic keys and API tokens that provide access to vast cloud environments. As these intrusions became more visible in late 2024, the security industry realized that the scale of the compromise was far greater than initially suspected, involving hundreds of repositories ranging from obscure personal projects to critical corporate assets. This situation highlights a dangerous vulnerability in how automated workflows are managed and monitored across the platform today.

Mechanisms: Account Hijacking and Workflow Manipulation

Exploit Tactics: Social Engineering and Deception

The tactical success of the GhostAction campaign is rooted in the strategic hijacking of reputable maintainer accounts, which allows attackers to operate within a cloak of established authority and developer trust. By gaining control of accounts such as those belonging to well-known figures like “henrywoo” or “kitao,” the perpetrators effectively bypass the initial scrutiny that usually greets contributions from unknown or new users. This approach leverages the psychological tendency of developers to trust code coming from verified contributors, especially when that code is presented as a security improvement. The primary vehicle for this intrusion is the creation of a malicious workflow file, often deceptively titled “security-audit.yml,” which masks its true purpose under the guise of a routine safety check. This social engineering tactic is remarkably effective because it discourages casual observers from investigating the file’s contents, as many developers assume a security-labeled workflow is a standard part of modern repository maintenance.

Automation Logic: Persistent CI/CD Exploitation

Once a malicious workflow file is committed to a repository, the inherent automation of GitHub Actions becomes the very engine that drives the theft of sensitive data without further human intervention. These workflows are designed to trigger automatically upon specific events, such as a code push or a pull request, meaning the malicious payload executes every time a developer interacts with the project in a standard way. This persistence is a hallmark of the GhostAction strategy, as it ensures that any new secrets added to the repository are captured almost immediately after they are committed to the code base. Because the execution happens within the trusted environment of the GitHub cloud, traditional endpoint security measures often fail to detect the unauthorized data transmission occurring in the background. This level of embedding within the CI/CD pipeline allows the attackers to maintain a long-term presence, effectively turning the software development lifecycle into a reliable data harvesting operation.

Data Exfiltration: Analysis of Historical Records

History Scanning: Deep Dive into Git Archives

A particularly alarming evolution in the GhostAction methodology is the transition from simple secret harvesting to a comprehensive analysis of the entire Git history of a targeted repository. By configuring the malicious script with the command “fetch-depth: 0,” the attackers force the GitHub Actions runner to download every commit, branch, and tag that has ever existed in the project’s timeline. This strategy is highly effective because it targets the common developer error of removing a secret from the current version of a file without properly scrubbing it from the underlying Git commit history. Even if a developer realizes they accidentally pushed an AWS key and deletes it in a subsequent commit, the key remains retrievable by anyone who can access the repository’s past states. The GhostAction script is specifically tuned to crawl through these historical layers, looking for patterns that match authentication headers, private keys, and session tokens that were presumed to be long gone or safely buried for years.

Expanded Scope: Harvesting Stolen Credentials

The technical sophistication of the exfiltration process is evident in the specific types of credentials the campaign seeks, ranging from cloud infrastructure keys to tokens for high-demand artificial intelligence services. The scripts are hardcoded to identify and extract AWS access keys, session tokens, and secrets for platforms like OpenAI, Anthropic, and Slack, ensuring that the attackers gain immediate access to high-value environments. Furthermore, the campaign targets package management tokens for registries such as PyPI and npm, which represent a critical bottleneck in the software supply chain as they allow for the publication of software updates. All captured data is bundled into a structured format and transmitted via an HTTP POST request to a fixed IP address, which serves as the central collection point for the stolen information. By capturing contextual lines of code surrounding these keys, the attackers can also verify the validity and scope of the credentials, making their subsequent exploitation efforts far more efficient.

Impact: The Vulnerable Software Supply Chain

Scale of Compromise: Automated Repository Targeting

The scale of the GhostAction campaign is unprecedented in its automation, allowing threat actors to compromise hundreds of repositories across various sectors with minimal manual effort or individual targeting. Security researchers have observed instances where over 300 repositories were modified within a single timeframe, indicating the use of advanced scripting tools that can identify and exploit vulnerable accounts across the entire GitHub platform simultaneously. This broad approach does not discriminate between active projects and “dead” or archived repositories, which often contain legacy secrets that remain valid and powerful. The inclusion of high-profile targets, such as the Pyxel project and Uber’s Athenadriver, demonstrates that even projects with significant oversight and thousands of stars are not immune to these automated hijacking techniques. This trend highlights a fundamental shift in the threat landscape, where the sheer volume of compromises creates a complex problem for security teams trying to identify and mitigate active intrusions.

Essential Defense: Remediation and Infrastructure Hardening

Remediation for the GhostAction intrusions required a far more comprehensive approach than simply deleting the malicious YAML files, as the exfiltration of historical data rendered previous secrets permanently compromised. Security professionals determined that the only effective response was a total rotation of every credential that was ever present in the repository’s history, regardless of whether it appeared in the latest code snapshot. This involved revoking AWS keys, rotating API tokens, and invalidating all active sessions or SSH keys associated with the hijacked accounts to ensure that the attackers could not maintain access through secondary channels. Additionally, organizations were urged to implement robust infrastructure hardening measures, such as mandatory push protection to block secrets from being committed and strict branch protection rules that required multi-party approval for any changes to workflow directories. The campaign served as a critical catalyst for a renewed focus on CI/CD security for all developers.

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