How Attackers Walked Into GitHub With Stolen Logins and Emptied the Vault

GitHub wfx-loot https://pixabay.com/illustrations/cyber-security-information-security-3400657/

An attacker began a campaign in early November that has since been dubbed wfx-loot by researchers at Aikido Security. The threat actor leveraged stolen GitHub credentials to compromise around 4,800 GitHub developer accounts and tested access against over 61,000 different repositories. The malware payload, designed to steal GitHub Actions secrets and cloud credentials, was executed in at least 1,835 of these cases.

No Exploit Needed with Valid Credentials

This campaign is particularly notable in the fact that it did not require the attacker to gain advanced hacking skills or exploit any flaws. No vulnerability in GitHub Actions was involved in the attack, just stolen tokens granting threat actors the authenticated, legitimate access associated with the compromised accounts.

With these credentials and this access, the attacker inserted malicious code into GitHub Actions workflows and install scripts. The deployment of this stealer software enabled GitHub’s trusted pipelines to do the attacker’s work for them, sending the infected repository’s stolen information straight to them.

Secrets Beyond Initial Access

Compromising developer accounts sounds bad enough on its own, but it is only the beginning in this campaign. These attacks lead to stolen repository secrets, cloud credentials, and API keys falling into the hands of threat actors. In the age of widespread AI tool and agent use, AI service keys are prominent among the targets in this campaign.

SafeDep reports more than 8,000 repositories with malicious commits in just the two days between November 10th and 12th, and the campaign continued running after that search. The threat actor also established backdoors in AWS and Azure that make new access keys, edit policies, and add credentials. These persistence capabilities enable attackers to maintain a presence on targeted systems long after the campaign finishes its run.

Erasing Evidence and Outsized Privileges

This campaign notably featured the threat actor making an effort to delete the evidence of their actions within targeted systems. Malicious commits were reverted after execution, and workflow logs were deleted to cover the attacker’s tracks. In its wake, the attack left repositories that appeared clean in spite of having already leaked sensitive secrets.

The ability to erase evidence points to other concerning abilities granted by the level of access of compromised accounts. “This also raises an important question about how much authority we're giving automated software delivery pipelines,” according to Ryan McCurdy, Vice President of Marketing, Liquibase. “If a compromised workflow has credentials that allow it to modify a production database, the consequences can extend well beyond credential theft.”

Only 3% of the tens of thousands of repositories tested in the campaign showed malware execution, demonstrating the strategic aims of the threat actor. “That ratio tells you attackers treat developer accounts as a sorting exercise, where the compromised account is just the entry, and the CI secrets sitting behind it are the prize,” says Seemant Sehgal, Founder & CEO, BreachLock. “A workflow file with access to AWS and Azure credentials carries more privilege than most production admin accounts, and almost nobody reviews it with that level of scrutiny.”

Visibility into Essential Processes

Protecting against attacks like this in the future requires improving visibility and monitoring to account for the capabilities demonstrated in the wfx-loot campaign. It is crucial to maintain visibility into all executed workflows, rather than just the current state of the code. This means the ability to view changes that have been made and maintain audit evidence that doesn’t depend on the pipeline.

An account is still compromised even if the probe pull requests submitted were not successful. The account that authored the request should have its tokens, grants, keys, and sessions revoked, and two-factor authentication (2FA) should be implemented. All secrets that can be read by the attempted repository and keys that can be reached by the runner should be rotated.

Treating the Pipeline as Privileged Infrastructure

It is essential to make changes to fight the structural weaknesses that enabled this campaign. Enforcing least-privilege credentials for every workflow ensures that accounts can only do so much damage if compromised by a bad actor. Any changes made to databases should be independently validated before production, and missing logs should always mean the assumption that compromise has occurred.

Author
  • PJ Bradley
    Contributing Writer, Security Buzz
    PJ Bradley is a writer from southeast Michigan with a Bachelor's degree in history from Oakland University. She has a background in school-age care and experience tutoring college history students.