DEV Community

jeffrey
jeffrey

Posted on

wfx-loot turns valid Git credentials into a CI secret collection pipeline

wfx-loot turns valid Git credentials into a CI secret collection pipeline

The wfx-loot campaign did not need a vulnerability in GitHub Actions. Security researchers quoted by SecurityWeek say the attacker used valid tokens belonging to developer and bot accounts to test repository access, then planted credential-stealing code where the stolen identities had enough permission to change files or workflows. Aikido counted about 4,800 compromised accounts opening probe pull requests against 61,764 repositories. The probe requests did not carry the payload by themselves. They tested whether the stolen identity could modify the target.

The campaign began around November 10. Aikido found signs that the stealer executed in more than 1,800 repositories, while SafeDep counted 8,093 public repositories that received malicious commits. Those are different measurements: a repository can receive a malicious commit without executing the workflow, and a workflow can execute without the attacker learning whether the stolen secret was useful. The numbers should not be added together or treated as a victim count.

The code was placed in existing or new GitHub Actions workflows, shell scripts run by CI, and npm installation hooks. The stealer searched for GitHub tokens, repository secrets, cloud credentials, and AI service keys. It also read GitHub Actions runner process memory and included functions intended to expand access and establish persistence in AWS and Azure. The attacker commonly reversed the code change and deleted workflow runs to make review harder.

Why valid credentials are the center of the attack

CI runners combine source code, secrets, cloud identities, package publishing rights, and the ability to execute scripts. A token that can edit a workflow may be able to turn a routine build into arbitrary code on a runner. The runner then exposes the credentials placed in its environment and process memory. The attacker does not need a GitHub vulnerability if the stolen account can ask the CI system to run a command.

The probe pull requests are an effective permission test. A failed pull request can show whether a token has write access, while a successful one creates a review artifact that may be dismissed as routine dependency work. Attackers can test thousands of repositories in a short time without immediately deploying the stealer. This makes the first visible event a noisy review queue rather than a direct production outage.

The npm hook adds a separate distribution edge. A developer who installs a changed dependency may run the hook outside CI, using a workstation identity that has broader repository and cloud access. The same payload can therefore reach both ephemeral runners and long-lived developer machines.

Response starts with credential scope

Organizations should assume that any secret accessible to a runner during the exposure window may have been copied, even if no workflow failure was recorded. Revoke personal access tokens, GitHub App credentials, repository deploy keys, package publishing tokens, cloud workload identities, and AI provider keys that were reachable from affected workflows. Rotate secrets after revocation, not before.

Review workflow runs for new steps that fetch remote scripts, decode base64 data, inspect process memory, or submit repository contents to an unknown endpoint. Check for changes in .github/workflows, shell scripts, npm lifecycle hooks, and branch protection exceptions. The attacker may have restored the original file after execution, so compare audit events and workflow metadata rather than only the current branch.

Constrain the credentials a workflow receives. Use job-specific permissions, pin actions to reviewed commits, and require approval for workflows from first-time contributors or changed workflow files. Avoid giving a build job a cloud role that can create new identities or modify account-wide resources. Keep package publishing in a separate protected job with a minimal token and an auditable release gate.

Look outside the repository

The campaign's post-access behavior included attempts to expand into AWS and Azure. Check cloud audit logs for new roles, access keys, trust policies, resource creation, and unusual token use during the campaign window. Search for new GitHub App installations and changes to organization or environment secrets. Review AI service billing for unexpected model calls or new API keys.

A repository cleanup is not enough if a runner token was copied. The response owner should trace every credential that could have been loaded into the affected job: environment variables, OIDC exchange permissions, mounted secret files, package registry tokens, and workload identity bindings. If the organization cannot establish the full list, rotate the broader identity scope and rebuild the runner image.

The campaign is a reminder that CI is a privileged execution platform. A valid identity can be more dangerous than a software bug, especially when review rules, workflow permissions, and branch access are inconsistent. The practical defense is to make each token narrow, short-lived, observable, and replaceable.

References

Top comments (0)