GitHub says poisoned VS Code extension led to theft of internal repositories
GitHub said on May 20 that an attacker stole internal source code repositories after compromising an employee's device through a malicious version of a popular Visual Studio Code extension. The Canadian Centre for Cyber Security issued alert AL26-013 on May 29 advising developers and GitHub Enterprise Server administrators to act.
The incident shows how a single poisoned developer tool can cascade. The extension, Nx Console, was compromised using credentials stolen in an earlier npm supply-chain attack, and was then used to reach one of the world's largest code-hosting companies.
What happened
GitHub said in its incident post that it detected and contained the compromise of an employee device on May 18. Its assessment is that only GitHub-internal repositories were exfiltrated. The attacker claims about 3,800 repositories, a figure GitHub described as directionally consistent with its investigation. GitHub said it has no evidence of impact on customer repositories or organizations, though some internal repositories contain customer information such as excerpts of support interactions.
Nx's postmortem says a malicious Nx Console v18.95.0 was published on May 18 under a legitimate core contributor's account. The attacker had stolen that contributor's GitHub CLI token on May 11 through a malicious npm package, @tanstack/[email protected], part of a broader TanStack compromise. The bad version was live for about 11 minutes on the Visual Studio Marketplace and about 36 minutes on Open VSX. It installed a backdoor and harvested cloud, npm, GitHub, SSH and other credentials. Nx counted 28 Marketplace installs and 41 Open VSX downloads, but about 6,000 activations in its own telemetry, and said true impact may be higher.
Signing key rotation
As a precaution, GitHub rotated its GitHub Enterprise Server signing key. Administrators must rotate the GPG public keys on their instances or future upgrades will fail verification. GitHub Enterprise Cloud customers need take no action.
What to do
- Remove Nx Console 18.95.0 and move to a known good version; Nx says 18.100.0 and later contain the fix.
- If the malicious version ran, treat the machine as compromised and rotate AWS, GCP, Azure, GitHub and npm credentials exposed between May 11 and 20, as the Cyber Centre advises. On macOS, check for ~/.local/share/kitty/cat.py.
- GitHub Enterprise Server administrators should run GitHub's key rotation script on every node and upgrade to patched releases.
- Disable automatic extension updates in sensitive environments and keep an allowlist of approved developer tools.