blog.rust.gay

wfx-loot stole CI secrets from thousands of GitHub repositories

The campaign known as wfx-loot targeted GitHub repositories not through a platform vulnerability, but by exploiting stolen GitHub credentials. Initiated around November 10, 2026, the threat actor deployed a sophisticated, multi-stage attack. This began with a subtle initial probe, disguised as a routine dependency audit, successfully opening probe pull requests in a massive scope: 61,764 repositories. While this immense reach demonstrates the scope of the compromised accounts, the actual malicious stealer payload executed in a smaller, critical subset—approximately 1,800 repositories. The payload's subsequent actions included harvesting highly sensitive secrets, cloud credentials (AWS, Azure, GCP), and AI tokens directly from the CI environment. The actor employed meticulous cleanup—reverting and deleting workflow runs within minutes—making the absence of a run number on the attacker's commit history, rather than the presence of an artifact, the definitive and most subtle indicator of compromise.

The Initial Probe: How Access Was Gained

The wfx-loot campaign was founded on the exploitation of stolen GitHub credentials, not a flaw in the GitHub platform itself. The threat actor used these compromised accounts to push seemingly innocuous probe pull requests, typically titled docs: dependency audit notes. This title was strategically chosen because it suggests standard documentation maintenance, significantly minimizing suspicion among repository collaborators. These probes were situated in a wfx-docs branch and leveraged ephemeral, short-lived chore/ branches. The probe's sole purpose was reconnaissance: confirming write access within the repository's CI configuration. This confirmed access was the necessary precursor; the high-impact malicious payload was only delivered in subsequent commits, often masked by routine commit messages like ci: refresh build cache. This sequence—benign probe followed by malicious injection—is a potent supply-chain deception, demanding deep security analysis beyond superficial PR reviews.

Three Delivery Variants of wfx-loot

The actor's technical adaptability is shown through three distinct methods for injecting the core stealer payload: 1. Workflow injection: Directly modifying an existing CI workflow file by adding roughly 1,500 lines of code, typically associated with commit messages like ci: refresh build cache. 2. Install hook: Implementing a .ci-xxxxxx.sh script alongside a postinstall hook configured within package.json, ensuring execution during standard dependency installation (e.g., npm install). 3. Throwaway branch: Creating a new workflow file (.github/workflows/build-audit-xxxxxx.yml) on an ephemeral chore/xxxxxxxx branch. This method establishes a new, targeted vector, relying on the CI runner's job scheduling to detect and execute the new workflow file.

What the Payload Collects: A Comprehensive Map of CI Secrets

The payload, a single, heavily commented shell script of about 1,500 lines, acts as a comprehensive sensor for the entire CI environment. It collects standard GitHub Actions secrets and variables, the GITHUB_TOKEN, and OIDC/Actions runtime tokens. More critically, its scope extends into enterprise infrastructure: credential files from AWS, Azure, GCP, Docker, Kubernetes, Git, and Vault paths, alongside detailed environment and memory data from running CI processes (Runner.Worker, Runner.Listener). This memory scraping capability is highly invasive, enabling extraction of JWTs, GitHub PATs, AWS keys, and AI provider tokens from runtime memory, a far more invasive action than mere file reading. The collection list is vast, covering credentials for leading AI tools: OpenAI, Anthropic/Claude, Gemini, Hugging Face, Cursor, and Copilot. Furthermore, it captures shell histories (bash, zsh, mysql, psql, python, node) and sensitive local files like .env, .pem, .p12, and kubeconfig under the $HOME directory, creating an exhaustive inventory of every access point the CI runner possesses.

The CI Threat Model

A CI workflow is far more than a build script; it is a highly concentrated point of secrets and identity. It holds repository secrets, temporary OIDC tokens, and runtime credentials for external cloud providers (AWS, GCP, Azure). While OIDC is a major security improvement over static secrets, the threat vector is not the token itself, but its exchange. The payload actively uses these short-lived tokens to mint persistent, long-lived cloud credentials (like iam:CreateAccessKey in AWS), negating the security benefits of OIDC. Furthermore, self-hosted runners, by nature, possess deeper system access—including instance metadata, Docker state, and host system files—making their compromise exponentially more severe than a cloud-hosted runner, as the actor gains direct host control. This makes the CI environment a critical target for infrastructure compromise, not just source code theft.

Escalation Tactics: From OIDC to Cloud Session Hijacking

The wfx-loot stealer's ultimate goal is permanent, stealthy control, going far beyond simple credential theft. It aggressively leverages OIDC tokens—designed for temporary, scoped access—to mint credentials for AWS, GCP, and Azure, transforming temporary tokens into persistent cloud infrastructure control. In AWS, the actor chains through existing IAM roles found within the runner's environment, executing iam:CreateAccessKey. This generates permanent, long-lived Access Key ID and Secret Access Key pairs, completely bypassing the ephemeral nature of OIDC sessions and establishing permanent infrastructure control. GCP escalation uses signed JWTs, created via a dependency-free Python RSA implementation, ensuring robustness in restricted CI environments. These signed JWTs are exchanged for access tokens, enabling project and service account enumeration, followed by API calls like generateAccessToken and signJwt. Azure exploitation is advanced: the actor exchanges OIDC tokens or client secrets for management tokens, then uses a Microsoft Graph token to enumerate subscriptions and Key Vaults. Crucially, they replay cached Azure CLI refresh tokens against first-party Microsoft client IDs (FOCI). This means the compromised repository acts as an identity provider for Azure services, guaranteeing access even across token rotation cycles. The stealer also integrates into infrastructure like HashiCorp Vault and Kubernetes API servers by replaying OIDC tokens against endpoints found in kubeconfig files, extending the compromise across the entire operational landscape.

Achieving Persistence: Bypassing Controls

The attack's longevity is guaranteed by mechanisms that survive standard security controls like secret rotation. Firstly, branch protection bypass is achieved by posting forged success status checks against the commit SHA, matching the required context name. This exploits the fact that GitHub Actions branch protection is context-based, not application-based, allowing the payload to clear mandatory merge gates during execution. Secondly, in AWS, the actor rewrites the chained role's trust policy to set "Principal": {"AWS": "*"}. This is a highly severe action, globally opening the role to any AWS account, completely subverting original security boundaries and granting permanent, unrestricted access. Thirdly, in Azure, injecting federated identity credentials (wfx-ci-...) into Azure AD applications links future workflows back to the compromised repository, ensuring long-term, secret-less authentication even after standard token rotation procedures are completed.

Branch Protection is Not an Authorization Boundary

The payload's ability to clear merge gates highlights a common misconception: that branch protection is an absolute security boundary. In reality, GitHub Actions branch protection rules are based on the context name required for a check (e.g., build-audit-pass), not on the identity or application that posted the status check. The attack successfully forged a success status check against the commit SHA using this context name. This means the control was bypassed via misinterpretation of the enforcement mechanism. To properly secure merges, organizations must implement checks that verify the source of the status check, not just its presence. This could involve custom checks that validate the OIDC identity of the posting workflow or requiring specific service-principal tokens that cannot be forged within the compromised CI environment, moving control from a mere metadata check to a verifiable authorization step.

Exfiltration Channels and the Campaign Specifics

The collected data is packaged into a gzipped tarball. While the payload supports numerous exfiltration paths—Actions Cache API, step summary (under 700 KB, base64 markers), artifact upload, direct HTTP POST, secondary callback, AES-encrypted commit, base32 output in logs, and Telegram Bot—the specific campaign observed by Aikido exclusively utilized HTTP POST to endpoints 194.150.166[.]244:8080/exfil or 18.143.168[.]96:8080/exfil. The absence of visible artifacts is not proof of non-exfiltration, as the actor typically deletes the entire workflow run. Therefore, identifying a missing run number on the attacker's commit history is the most reliable indicator of compromise.

Detection: Run-Number Gaps and Audit Logs

Because the actor aggressively cleans up the workflow run after exfiltration, traditional artifact scanning is unreliable. The most reliable sign of compromise is the forensic observation of a missing run number associated with the malicious commit in the workflow history. A thorough investigation requires comparing repository workflow history logs against comprehensive audit logs from GitHub, AWS, Azure, and GCP. Investigators must scope the search not just to the repository but also to the associated compromised accounts and timeframes (e.g., November 10-11, 2026). Look for unexpected file changes in .github/workflows/, new branches named wfx-docs, and PRs titled docs: dependency audit notes. A gap in the expected sequence of workflow runs, combined with unusual cloud API calls (like iam:CreateAccessKey), provides strong evidence of the payload execution, even if the run itself is deleted.

Package Spillover and Secondary Risks

The compromise led to a wider supply chain risk: at least 50 compromised users who publish packages across npm, Go, Packagist, and PyPI. Specific malicious packages identified include Packagist digitalelvis/neuronai-studio version 3.14.3, and Go modules github.com/onuragtas/docker-env versions v1.0.278 and v1.0.280. It must be stressed that the malicious code resides only within the GitHub Actions workflow file; the Go source and compiled binaries were not altered. This demonstrates how CI compromise can contaminate public package registries, significantly expanding the attack's supply chain reach.

Response Order Matters

Incident response must prioritize containment and eradication over merely restoring functionality. The sequence is critical: First, immediately revoke all tokens and rotate all compromised secrets. Second, actively identify and remove all persistence mechanisms (e.g., trust policy rewrites, federated identity injections, forged checks). Rotating secrets before removing persistence leaves a live, permanent backdoor. Subsequent steps include: auditing cloud roles for unauthorized creation, checking package publications across affected ecosystems, notifying all downstream users, and rigorously reviewing and isolating all self-hosted runners. This structured, layered approach ensures the threat is fully eradicated, not just momentarily patched.

Hardening the Next Workflow

Future CI workflows must adopt a zero-trust, least-privilege posture. Enforce minimal permissions in the workflow definition—only grant access required for the specific job. Use pinned actions instead of floating versions to prevent dependency confusion or supply-chain attacks within the workflow itself. Leverage OIDC trust policies correctly by strictly defining the trusted OIDC issuer and audience, rather than relying on broad token exchanges. Protect environments using secrets encryption and environment protection rules. Crucially, avoid reliance on pull_request_target in critical workflows, as this allows code to run in a way that bypasses standard PR safety checks. These layered controls ensure that even if a credential is stolen, its scope is minimal and temporary.

Conclusion

The wfx-loot campaign is a reminder that CI is a production identity provider. A repository token is not a minor convenience; it is a key to secrets, cloud roles, and package registries. The response cannot stop at rotation. Teams need to remove the persistence the payload created, audit the cloud roles it touched, and check what it published. The boring controls—least-privilege workflow permissions, pinned actions, narrow OIDC trust policies, and protected environments—are the ones that shrink the blast radius when a token is stolen.

Sources


← back to posts