Using hijacked GitHub accounts, an attacker siphons passwords and cloud keys out of thousands of software projects
Ghent-based security firm Aikido counts nearly 62,000 targeted repositories, and at least 1,800 of them actually ran the malicious code.
Since Tuesday 10 November, an attacker has been using stolen GitHub credentials to plant malicious code in users' projects. That is according to Aikido Security, which calls the campaign wfx-loot. Aikido says 4,837 compromised accounts opened probing pull requests in 61,764 repositories. In at least some 1,800 projects the code ran and credentials were stolen, and the real number may be higher because the attacker deleted logs. Cyberpress reports that about 92 percent of those probing pull requests were still open, suggesting most owners had noticed nothing.
The method is cunning. The attacker first opens a pull request that looks like documentation to test for write access. The actual payload follows: a modified GitHub Actions workflow, a script that runs during npm install, or a throwaway workflow on a separate branch. Within about a minute the attacker reverts the change and deletes the run and its logs, so often the only trace left is a missing run number in the workflow history. The script collects secrets, environment variables, credential files, shell history and process memory, and uses them to break into AWS, Google Cloud, Azure, Vault and Kubernetes. According to Aikido, it also forges successful status checks to get past branch protection and alters trust policies in AWS.
Aikido believes the attacker is mainly after those secrets rather than primarily trying to spread poisoned packages. Even so, at least fifty affected users publish packages on npm, Go, Packagist, PyPI or crates, and through automated publishing the code has already reached one Packagist package and one Go module, which Aikido names. There is overlap with October's GhostActions wave, but the company attributes the two to different actors. Its advice to anyone affected: assume that every secret and cloud role the workflows could use is compromised, replace them, and check AWS trust policies and Azure federated identities.