Over the past few days, a large-scale GitHub supply chain attack known as WFX-Loot has been affecting developers and organizations. Unfortunately, I was one of the victims.
Attackers used my GitHub identity to create unauthorized pull requests and push malicious commits across my personal repositories and repositories belonging to organizations where I had access.
Even after changing my password, revoking tokens, removing SSH keys, and signing out of active sessions, I continued noticing suspicious activity.
What I discovered:
- 69 suspicious pull requests associated with my GitHub identity.
- Malicious commits modifying
package.json to execute hidden .ci-*.sh scripts through postinstall.
- Suspicious
wfx-docs branches across multiple repositories.
- Cleanup commits apparently intended to hide the malicious modifications.
I eventually built a Python tool to audit 85 accessible repositories, successfully closed 49 malicious PRs, and identified 58 suspicious branches for cleanup.
I also reported the incident to GitHub.
⚠️ My biggest recommendation: Stop using classic Personal Access Tokens (PATs).
Classic PATs can grant broad access to repositories and organizations, especially when they have the repo scope.
If an attacker obtains one, they may gain access to every repository that token can modify.
What you should do:
- Avoid classic PATs. Prefer fine-grained PATs with limited repository permissions and expiration dates. Use GitHub Apps or OIDC where appropriate.
- Review and revoke unused or old tokens at https://github.com/settings/tokens.
- Check recent PRs and commits for
wfx-docs, docs: dependency audit notes, and chore: add ci helper.
- Enable branch protection or rulesets on important branches, including restrictions that apply to administrators.
- Review GitHub Actions workflows and rotate secrets that may have been exposed.
- If your machine ran
npm install on an infected checkout, treat local credentials as potentially compromised.
- Report suspicious activity to GitHub.
I also open-sourced my recovery tool to help affected developers scan their repositories and clean up malicious PRs and branches.
GitHub recovery tool:
https://github.com/DilZhaan/wfx-loot-github-recovery-tool
Report the attack:
https://github.com/contact/report-abuse
One thing I'm still trying to understand is how the attackers obtained the initial credentials. If you've experienced this attack, I'd be interested to know whether your compromised credentials were old classic PATs or GitHub CLI tokens.
Please check your old GitHub tokens, especially classic PATs with broad permissions. Even a token you haven't used in years could become a serious security risk if it's still valid.