Hijacked GitHub Accounts Slip Credential Stealer Past Approval Gates

| 5 min read

A campaign using hijacked GitHub accounts has planted a secret-stealing payload in at least 1,806 repositories, and the true count may be higher. The attackers used 4,837 compromised accounts to open probe pull requests across 61,764 repositories starting Nov. 10. About 92% of those pull requests, titled "docs: dependency audit notes," are still open, which suggests most maintainers never looked at them.

The probes were a reconnaissance step. They checked which hijacked accounts had write access, so the attackers could follow up with commits carrying the real payload: a 1,500-line shell script that harvests GitHub Actions secrets, cloud credentials, and API keys for AI services and developer tools.

Aikido Security, which detected and documented the campaign, said in its report that the payload ran in at least 1,806 repositories. "The run log was deleted in impacted repositories, meaning the threat actor has likely collected the credentials and covered its tracks."

The npm hook that slipped past GitHub

GitHub's defenses worked against the payloads they could see. The platform has blunted recent workflow-injection campaigns by requiring explicit approval before malicious workflows run. GitGuardian found that all seven November payload runs still visible in workflow files sat in an action_required state and never executed.

The attackers went around that gate. Here's the thing: the payload didn't need a workflow change at all. It added a hidden script to the repository root and a single line to package.json that runs on every npm install. The repositories' own unchanged workflows were already calling npm install as routine build hygiene, so the code ran on schedule.

"GitHub held the workflow forms, but an npm hook slipped past the hold and ran," said Gaetan Ferry, a security researcher at GitGuardian, in an analysis of the campaign.

By Thursday, the attacker had also changed how it moved stolen data out. The newest version sends everything to a Telegram chat, and its HTTP callback points to a dead address. Blocking the IP addresses published earlier no longer stops the latest variants.

What the malware takes

Once running, the script dumps every repository and organization secret available to the workflow as JSON. It also scans the memory of the runner process, where secrets sit in decrypted form, so it picks up values the workflow never referenced. From there it collects credential files from common paths, shell histories, and API keys for OpenAI, Anthropic, Copilot, and Cursor.

The cloud reach is the most worrying part. The script exchanges OIDC tokens for AWS, GCP, and Azure sessions, mints new long-lived AWS access keys, impersonates GCP service accounts, and replays cached Azure refresh tokens to reach Microsoft Graph and Key Vault.

Everything gets packed into a gzipped archive and sent out, and then the script cleans up after itself. In most repositories, the attacker reverted the malicious commit within a minute and deleted the workflow run and its logs.

Backdoors that survive rotation

The script also sets up persistence, so resetting credentials won't fully lock the attacker out. On AWS, it rewrites the assumed role's trust policy to accept any AWS account, which effectively opens the role to anyone. It also calls iam:CreateAccessKey to mint long-lived keys for IAM users.

On Azure, it injects federated identity credentials named wfx-ci-* into applications and points them back at the compromised repository. Any workflow in that repository can then authenticate to Azure with no stored secret, even after every token has been rotated.

If a probe pull request or any of the campaign's commit strings show up in a repository you control, assume every secret that repository's workflows could reach has been stolen. Rotate repository and organization secrets, package registry tokens, and cloud keys. Because the memory scan grabs more than workflows reference, the exposure list is wider than the secrets your pipelines declare.

Then hunt for the persistence mechanisms: AWS role trust policies that accept any account, IAM access keys created since Nov. 10, and Azure federated credentials named wfx-ci-*.

"Ensure all logs are enabled, particularly audit logs on cloud admin behavior," said Ramy Rahman, senior principal solutions engineer at ArmorCode. "Inspect audit logs where possible, specifically in AWS and Azure, as persistence is possible, to ensure the malicious payload did not run."

The wfx-loot payload also shipped inside published packages: the Packagist package neuronai-studio 3.14.3, and the Go modules docker-env and gocurl. In the Go modules, the payload sits only in a workflow file that Go tooling never executes, so consumers may be unaffected. Anyone who installed the Packagist version should treat that machine as compromised.

GitGuardian also reported that about a fifth of the accounts used in this campaign had already been compromised in the GhostAction attack in October. Researchers at StepSecurity traced 173 of the probe pull requests to tokens issued to the Fly.io GitHub App. Fly.io confirmed those tokens leaked after its deploy process left them in .git/config files inside build directories that some apps served publicly. The company said it was not breached. GitHub's bulk revocation of the Fly.io app tokens stalled partway through, so some tokens in the stolen pool may still work.

Source: William Miller · www.csoonline.com