Rotate Secrets After GitHub Actions Compromise: What wfx-loot Leaves Running

The wfx-loot stealer rewrites AWS role trust policies, adds Azure federated credentials and can forge required checks, none of which rotation removes. The cleanup order that works, with the commands for each step.

By VVV Ops ·

Since 10 November 2026, an attacker has been pushing a CI secret stealer into GitHub repositories with stolen account tokens. By Aikido's count, 4,837 compromised accounts opened probe pull requests in 61,764 repositories, and at least 1,835 repositories ran the payload and had credentials exfiltrated. Aikido tracks the campaign as wfx-loot; StepSecurity calls it WFX Phantom.

The usual response to a leaked CI secret is to rotate everything the workflow could read. This payload was written with that response in mind. Aikido describes three actions "designed to outlast credential rotation": an AWS role trust policy opened to every AWS account, Azure federated identity credentials that trust the compromised repository, and forged status checks that clear branch protection. Rotation touches none of them, so the order of the cleanup matters as much as its speed. Rotate first and the attacker can come back through the trust policy with fresh credentials. Revoke AWS sessions before fixing the trust policy and any session issued half a minute later works again.

For the policy rules that stop a stolen token from starting workflows at all, see our post on workflow execution protections. This one assumes the payload already ran, and gives the order we would clean up in, with the commands. The order is ours. StepSecurity's checklist puts rotation ahead of removing persistence, and Aikido gives none.

What the payload changes outside GitHub

The payload is a shell script of about 1,500 lines that runs inside a workflow job. Besides collecting toJSON(secrets), toJSON(vars), the GITHUB_TOKEN and the runner's process memory, it uses the job's OIDC token to open sessions in AWS, GCP and Azure. StepSecurity's analysis lists what it does with them:

  • In AWS it rewrites an assumed role's trust policy to "Principal": {"AWS": "*"} and tries iam:CreateAccessKey for IAM users. Its sessions are named wfx-<pid>.
  • In Azure it adds a federated identity credential named wfx-ci-<n> to Azure AD applications, trusting workflows in the compromised repository. Those workflows can then sign in to Azure with no stored secret.
  • In GitHub it can post passing statuses under the names of the repository's required checks.

The two write-ups disagree on that last item. Aikido describes the forged statuses as posted early in the run, before most collection. StepSecurity says the capability is built in and that none of the 101 copies it examined had it switched on. We would treat it as present until the commits merged during the window have been checked.

Blocking the published collection IPs does not tell you whether you were hit. From about 05:30 UTC on 12 November, StepSecurity found new copies sending stolen data only to a Telegram chat, with no collection IP at all.

Find the runs that were deleted

The attacker reverts the commit and deletes the workflow run and its logs, usually within a minute. StepSecurity calls a missing run number right after a suspect commit "the most reliable sign that the stealer ran". run_number increments per workflow, so a gap inside one workflow's sequence is the signal:

# List runs from 1 November, so each workflow has a baseline from before the
# campaign, and print gaps in its run numbers.
REPO=acme/payments-api
gh api -X GET --paginate "repos/$REPO/actions/runs" -f created='>=2026-11-01' -F per_page=100 \
  --jq '.workflow_runs[] | [.workflow_id, .run_number] | @tsv' \
  | sort -k1,1n -k2,2n \
  | awk -F'\t' '$1 == wf && $2 > prev + 1 { print "workflow " $1 ": missing runs " prev+1 " to " $2-1 } { wf = $1; prev = $2 }'

The check has two blind spots. With the created filter the endpoint returns at most 1,000 results per search, so a busy repository needs narrower date ranges. And one delivery method adds a new file, .github/workflows/build-audit-<6 characters>.yml, on a throwaway chore/<8 characters> branch. A new workflow has no earlier runs, so its deleted first run leaves no gap.

For repositories owned by an organization, the audit log is the better record. workflows.delete_workflow_run carries the run_number, head_sha and actor of each deleted run. workflows.prepared_workflow_job is the one that scopes the rotation: per GitHub's audit log reference it "includes the list of secrets that were provided to the job" in a secrets_passed field. That event does not appear in the web interface, only through the REST API, audit log streaming, or a JSON or CSV export. The REST endpoint needs GitHub Enterprise Cloud; on other plans an owner can use the Export menu on the audit log page. The log covers the last 180 days.

# Enterprise Cloud orgs. Inspect one raw event first: the jq below assumes
# the additional fields sit at the top level of each event.
ORG=acme
gh api -X GET --paginate "orgs/$ORG/audit-log" -F per_page=100 \
  -f phrase='action:workflows.delete_workflow_run created:>=2026-11-10' \
  --jq '.[] | [.repo, .actor, .run_number, .head_sha] | @tsv'

Then run the same query with action:workflows.prepared_workflow_job and match on workflow_run_id. The secrets_passed list on each matching job is the minimum set to rotate in that repository.

Cut GitHub access before the cloud cleanup

The Azure credential the payload adds trusts workflows in the compromised repository. Whoever can still push a workflow there can mint Azure tokens with it, and the stolen GitHub tokens are what let the attacker push. Closing GitHub access first stops new persistence from being written while you remove the old.

StepSecurity's list of what to revoke is the right one: the compromised account's personal access tokens, OAuth grants, SSH keys and sessions. Look past personal tokens. On 173 of the probe pull requests, opened from 19 accounts, GitHub recorded that the request came through the Fly.io GitHub App (fly-io, app ID 34557), so the attacker held tokens that app had been issued to act as those users. StepSecurity says it has no evidence of a breach of Fly.io's infrastructure. Authorized apps on an affected account belong on the revocation list.

Close the probe pull requests (docs: dependency audit notes, from a wfx-docs branch) and delete the wfx-docs, chore/<8 characters> and ci-check-<4 digits> branches. While you are in the settings, check who sits on a branch protection or ruleset bypass list. StepSecurity's remediation asks whether bot accounts there need that right at all, and a bypass entry on a compromised account makes every merge gate below irrelevant.

AWS: fix the trust policy, then revoke sessions

The trust policy comes first because of how session revocation works. The IAM console's Revoke active sessions attaches an inline policy named AWSRevokeOlderSessions that denies everything to sessions issued before a timestamp. AWS documents that it denies sessions assumed in the past "as well as approximately 30 seconds into the future", and that anyone who assumes the role after that is unaffected. With the trust policy still open to every AWS account, the attacker assumes the role again from any account they control and gets a clean session.

Find the open roles, the IAM changes, and the keys created during the window:

# 1. Roles whose trust policy allows any AWS principal.
aws iam list-roles --output json | jq -r '.Roles[]
  | select(any(.AssumeRolePolicyDocument.Statement | if type == "array" then .[] else . end;
      .Effect == "Allow" and (.Principal == "*" or ([.Principal.AWS?] | flatten | index("*")) != null)))
  | .RoleName'

# 2. Trust policy rewrites and new access keys. IAM events are recorded in us-east-1.
for ev in UpdateAssumeRolePolicy CreateAccessKey; do
  aws cloudtrail lookup-events --region us-east-1 \
    --lookup-attributes AttributeKey=EventName,AttributeValue=$ev \
    --start-time 2026-11-10T00:00:00Z \
    --query 'Events[].[EventTime,Username,Resources[0].ResourceName]' --output text
done

# 3. IAM user access keys created since the campaign began.
aws iam list-users --query 'Users[].UserName' --output text | tr '\t' '\n' | while read -r u; do
  aws iam list-access-keys --user-name "$u" --output json \
    | jq -r '.AccessKeyMetadata[] | select(.CreateDate >= "2026-11-10") | [.UserName, .AccessKeyId, .Status, .CreateDate] | @tsv'
done

CloudTrail event history keeps 90 days of management events per Region. For activity from 10 November that runs out around 8 February 2027, so export what you find to S3 or CloudTrail Lake before then. StepSecurity also suggests searching for AssumeRoleWithWebIdentity or AssumeRole calls with a session name starting wfx-. STS events land in the Region of the endpoint that was called, so run that search in each Region you use.

For an ongoing check, IAM Access Analyzer analyzes role trust policies and reports roles that an entity outside your zone of trust can assume. A role is global, so the finding appears in each Region where the analyzer is enabled.

The cleanup order per account:

  1. Restore each open role's trust policy from your infrastructure code, or with aws iam update-assume-role-policy. If the roles live in Terraform, the rewrite shows up as drift on the next refreshed plan, which is also how you prove the restore.
  2. Revoke sessions on those roles. The CLI form attaches the same deny with a timestamp you choose:
{
  "Version": "2012-10-17",
  "Statement": {
    "Effect": "Deny",
    "Action": "*",
    "Resource": "*",
    "Condition": {
      "DateLessThan": { "aws:TokenIssueTime": "2026-11-26T12:00:00Z" }
    }
  }
}

Attach it with aws iam put-role-policy --role-name <role> --policy-name AWSRevokeOlderSessions --policy-document file://revoke.json. Pick a timestamp after the trust policy fix, and include the roles your GitHub OIDC provider can assume, since the payload opened sessions through them.

  1. Deactivate, then delete, every access key the third command found that nobody on your team created.

Azure and GCP: trust that needs no secret

A federated identity credential has no secret, so there is nothing to rotate. It stays valid until somebody deletes it. Do not filter on the wfx-ci- prefix alone: the attacker picks that name, and the next variant can pick another. List every credential on every app registration and review each one whose issuer is GitHub:

# Every federated credential on every app registration, with its subject.
az ad app list --all --query '[].appId' -o tsv | while read -r app; do
  az ad app federated-credential list --id "$app" \
    --query "[?starts_with(issuer, 'https://token.actions.githubusercontent.com')].[name, subject]" -o tsv \
    | awk -v app="$app" '{ print app "\t" $0 }'
done

# Remove one that does not map to a workflow you own.
az ad app federated-credential delete --id <appId> --federated-credential-id <name-or-id>

A subject starting repo:<org>/<repo>: that points at an affected repository (or repo:<org>@<id>/<repo>@<id>: for repositories on GitHub's immutable subject claims, the default for those created after 15 July 2026) and was not created by your own infrastructure code is the one to delete. --all matters here: without it az ad app list returns only the first 100 applications.

Federated credentials are the pattern we recommend in our post on replacing static API keys with workload identity, and this campaign shows their cost: a credential with nothing to rotate has to be inventoried instead. For GCP, StepSecurity points at GenerateAccessToken and SignJwt calls through your workload identity pool. For Vault and Kubernetes, review logins that used tokens issued by token.actions.githubusercontent.com during the window.

Rotate what the job could read

With the doors closed, rotation is worth doing. toJSON(secrets) returns every secret available to the job: repository, organization and environment secrets in scope. Use secrets_passed from the audit log as the floor and the job's full scope as the target. The payload also copied environment variables whose names match keywords such as token, secret, aws, openai and anthropic, and credential files from the standard paths for npm, PyPI, Docker, Kubernetes, Vault, Terraform, SSH and GPG. AI provider keys sit in plenty of CI environments now, and they were on the list.

The npm hook variant needs separate handling. It adds a hidden .ci-<6 characters>.sh file and a postinstall hook to package.json, which runs on any npm install. StepSecurity's advice is to rotate credentials on any developer machine that ran npm install on an affected repository during the window. That reaches past CI, into laptops your secret inventory does not cover.

Self-hosted runners and packages published in the window

On self-hosted runners the payload also collects cloud instance metadata credentials, Docker state and systemd units. Rebuild those hosts and treat the instance role as compromised.

At least 50 of the compromised users publish packages to npm, Go, Packagist, PyPI or crates, per Aikido. If you publish from CI, check for versions released between a malicious commit and its ci: cleanup revert, and rebuild them from a clean commit, as StepSecurity advises. Aikido names Packagist digitalelvis/neuronai-studio 3.14.3, and Go module github.com/onuragtas/docker-env v1.0.278 and v1.0.280, where the payload sits in a workflow file only. StepSecurity adds the Go module github.com/vkuznet/gocurl at v0.0.0-20261111095532-8d5aad0cb0da. On the consuming side, a release-age cooldown keeps a freshly published bad version out of your installs; we covered that in our npm dependency cooldown post.

Merge gates that a forged status can pass

Aikido writes that branch protection "matches on the context name, not on the app that posted it". That describes the default. GitHub lets you select an app as the expected source of a required status check, and "if the status is set by any other person or integration, merging won't be allowed." In a ruleset, the same setting is integration_id on each entry in required_status_checks. Read the app ID from a check run your CI already posted, with gh api repos/$REPO/commits/<sha>/check-runs --jq '.check_runs[] | [.name, .app.slug, .app.id] | @tsv'.

Pinning the source rejects statuses posted with a user's stolen token. A status posted from inside a run with that run's own GITHUB_TOKEN may still carry your CI's identity, so pair it with a review rule a single stolen account cannot meet. require_last_push_approval means "the most recent reviewable push must be approved by someone other than the person who pushed it". The rules below are illustrative. The context name and integration_id are placeholders, so read your own from the check-runs call above:

[
  {
    "type": "required_status_checks",
    "parameters": {
      "strict_required_status_checks_policy": true,
      "required_status_checks": [
        { "context": "build-and-test", "integration_id": 1234567 }
      ]
    }
  },
  {
    "type": "pull_request",
    "parameters": {
      "required_approving_review_count": 1,
      "require_last_push_approval": true,
      "require_code_owner_review": true,
      "dismiss_stale_reviews_on_push": true,
      "required_review_thread_resolution": false
    }
  }
]

That raises the cost from one compromised account to two in the same organization. For what already merged, list the pull requests merged into protected branches since 10 November and check each head commit's statuses with gh api repos/$REPO/commits/<sha>/statuses --jq '.[] | [.context, .state, .creator.login] | @tsv'. A required context whose creator is a person, where your CI app normally posts it, is a commit to read line by line.

If you would like a second pair of hands on this, contact us. We would start with the audit log export of delete_workflow_run and prepared_workflow_job events since 10 November, laid next to every role trust policy and federated credential those jobs could reach, because that pairing tells you which rotations matter and which back doors are still open.

Tags: rotate secrets after github actions compromise, integrate security into ci/cd pipeline, security automation, devsecops best practices for startups, github actions secret stealer, aws trust policy persistence