GitHub Internal Repositories Breach via Nx Console (May 2026)
On Monday, 18 May 2026, a GitHub employee's laptop updated a VS Code extension. The extension was Nx Console, a widely used monorepo tool published by Nrwl, the company behind Nx. The new version, 18.95.0, was genuine in the sense that it came from the real publisher account on the real marketplace. It was malicious in every other sense. When a workspace opened, it quietly ran a 498 KB obfuscated credential stealer. Within hours, an attacker group tracked as TeamPCP had used what it harvested to copy roughly 3,800 of GitHub's internal repositories, then put them up for sale.
The malicious version was on the Visual Studio Marketplace for about 18 minutes. That was long enough.
This incident is worth studying because nothing about it was exotic. There was no zero-day in VS Code or in GitHub. The chain was made of ordinary pieces: a package install that ran a script, a CLI token sitting where any local process could read it, a release pipeline that let one person publish alone, and an editor that auto-updates extensions. Each link was a known weakness. Lined up, they reached one of the most security-conscious software companies in the world.
TL;DR
- What: Nx Console
18.95.0(extension idnrwl.angular-console) was published on 18 May 2026 with an injected loader. On workspace open it fetched and ran a credential-stealing payload stored in an orphan commit inside the officialnrwl/nxGitHub repository. Tracked as CVE-2026-48027 / GHSA-c9j4-9m59-847w. - How the attacker got publish rights: on 11 May an Nx contributor ran
pnpm installin an unrelated project that pulled a compromised@tanstack/*package. Itspreparescript stole the contributor's GitHub CLI token. Seven days later that token was used to plant the payload and ship the extension (Nx postmortem). - Biggest victim: GitHub. A GitHub employee's device installed the bad version. GitHub says the activity "involved exfiltration of GitHub-internal repositories only" and that the attacker's claim of about 3,800 repositories was "directionally consistent" with its investigation (GitHub blog).
- Detection: a Nx maintainer got the routine "new version uploaded" email for a release nobody had made. Nx: "We did not detect this through any system we built."
- Fix: unpublish, revoke, rotate. Nx moved to two-person publish approval and OIDC trusted publishing. GitHub rotated critical secrets and, on 26 May, its GitHub Enterprise Server signing key, which forced every GHES admin to run a key rotation script.
- Lesson: developer endpoints are production. Any extension, package script or CLI on a laptop runs with all the credentials that laptop holds.
The Alert
Two alerts fired on 18 May, in two different companies.
At Nrwl, the alert was an email. The Visual Studio Marketplace sends publishers a notification when a new version is uploaded. At 12:36 UTC a maintainer received one for 18.95.0, a version nobody on the team had built. They unpublished it from the Marketplace at 12:47 (registered at 12:48) and from Open VSX at 13:09. Open VSX sends no equivalent email, which is why the Open VSX window was twice as long (Nx postmortem).
At GitHub, the alert was a compromised employee device. GitHub's statement says that on Monday 18 May it "detected and contained a compromise of an employee device involving a poisoned VS Code extension published by a third party" (GitHub blog). GitHub has not said publicly how it detected the compromise (EDR alert, anomalous clone volume, or the Nx advisory). As of this page's review date, the "fuller report" GitHub promised had not been located by the author.
The public found out the other way round: from the attacker. On 19 May, TeamPCP listed what it said were about 4,000 private GitHub repositories for sale on a cybercrime forum, asking at least $50,000 (The Hacker News, SecurityWeek). GitHub posted on X that it was investigating unauthorised access to its internal repositories (GitHub on X), and published its blog statement on 20 May.
Why this one is uncomfortable
GitHub runs the platform most of the world's source code and CI lives on. It was not breached through its own product. It was breached through a tool one engineer used inside their editor, which was itself breached through a package a different engineer installed in an unrelated project a week earlier. The trust boundary that failed was the developer laptop.
Impact
| Item | What is known | Source |
|---|---|---|
| Malicious artefact | Nx Console 18.95.0, nrwl.angular-console | GHSA-c9j4-9m59-847w |
| CVE | CVE-2026-48027 | GHSA, The Hacker News |
| Exposure window | VS Marketplace 12:30–12:48 UTC (about 18 min). Open VSX 12:33–13:09 UTC (about 36 min) | Nx postmortem |
| Marketplace counts | 28 installs (Microsoft), 41 downloads from 21 unique IPs (Open VSX) | Nx postmortem |
| Nx telemetry | About 6,000 activations of 18.95.0 in VS Code and 1 in Cursor within two days | GHSA |
| GitHub data | About 3,800 internal repositories exfiltrated, per attacker claim GitHub called "directionally consistent" | GitHub blog |
| Customer data | "No evidence" of impact outside internal repositories, but some internal repos hold "excerpts of support interactions" | GitHub blog |
| Downstream action | GHES signing key rotated, all GHES admins must rotate GPG keys before future upgrades | GitHub blog (26 May update) |
| Not affected | Nx CLI (nx npm package), @nx/* plugins, Nx Cloud | Nx postmortem |
The disputed numbers
Several figures in this incident do not agree, and it is worth being honest about why.
- 28 vs about 6,000. Microsoft's Marketplace counted 28 installs. Nx's own extension telemetry counted about 6,000 activations (an activation is the extension starting up, not a fresh install). Nx said the gap was "still being reconciled with Microsoft." One plausible explanation is that auto-update does not always count as an install in Marketplace statistics, but neither Nx nor Microsoft has confirmed that. Treat "dozens to thousands" as the honest range.
- Was Open VSX affected? StepSecurity's early write-up said Open VSX was not affected and put the Marketplace window at 12:36–12:47 (StepSecurity). Nx's later postmortem, with access to registry logs, says Open VSX served it from 12:33 to 13:09 and that 12:36 was when the notification email arrived, not when the upload happened. This page uses Nx's timeline.
- When did GitHub disclose? GitHub's X post came on 19 May. Its blog statement is dated 20 May. Both dates appear in reporting.
- 4,000 or 3,800 repos? The attacker claimed about 4,000. GitHub confirmed "~3,800" as directionally consistent.
- The sale price. TeamPCP's first listing asked at least $50,000. By 21 May the data was re-listed at , with a post saying "No ransom, we do not care about extorting GitHub" (The Hacker News, Flare). Hackread reported the starting price differently. These are criminal forum claims and cannot be verified. Whether any buyer paid, and whether the data has leaked publicly, is not known from the sources reviewed.
- What was in the repos. A researcher quoted by The Hacker News said the repositories relate to GitHub Actions, Copilot internal projects, CodeQL tooling, Codespaces, Dependabot, internal infrastructure and security tooling. GitHub has not published a list.
Timeline
sequenceDiagram
participant T as TeamPCP
participant TS as TanStack packages on npm
participant Dev as Nx contributor laptop
participant GH as GitHub API
participant NX as nrwl-nx repo
participant MP as VS Marketplace and Open VSX
participant Emp as GitHub employee laptop
participant GHI as GitHub internal repos
Note over T,TS: 11 May — TanStack wave
T->>TS: 19:20-19:26 UTC publish 84 malicious versions
Dev->>TS: 20:43 UTC pnpm install pulls @tanstack/zod-adapter 1.166.15
TS-->>Dev: prepare script runs credential harvester
Dev-->>T: gh CLI OAuth token stolen
T->>GH: 20:43:51 first malicious commit with stolen token
T->>GH: 20:44 bulk-delete CodeQL workflow runs
Note over T,GH: 15-16 May — token reused, last use 16 May 00:04
Note over T,MP: 18 May — publication
T->>NX: 03:18 UTC push orphan commit 558b09d7 holding payload
T->>MP: 12:30 UTC upload Nx Console 18.95.0
MP-->>Emp: auto-update installs 18.95.0
Emp->>NX: workspace open, npx fetches orphan commit
Emp-->>T: credentials exfiltrated
MP-->>Dev: 12:36 upload email to maintainer
Dev->>MP: 12:47 unpublish Marketplace, 13:09 unpublish Open VSX
T->>GHI: clone about 3,800 internal repositories
Note over Emp,GHI: GitHub detects and contains the device the same day
| Time (UTC) | Event | Source |
|---|---|---|
| 11 May, 19:20–19:26 | 84 malicious versions published across 42 @tanstack/* npm packages (the "Mini Shai-Hulud" wave) | Nx postmortem, TanStack postmortem |
| 11 May, 20:43:01 | Nx contributor runs pnpm install in a repo outside the nrwl org, resolves @tanstack/zod-adapter@1.166.15 (77 minutes old). Its prepare script runs a 2.3 MB obfuscated harvester | Nx postmortem |
| 11 May, 20:43:51 | First malicious commit pushed with the stolen credentials, "within 74 seconds of execution" | Nx postmortem |
| 11 May, 20:44:15–20:45:56 | "CodeQL Analysis" workflow runs bulk-deleted across several repos | Nx postmortem |
| 11 May, 21:34–21:37 | Malware runs again on a repeat install, a second deletion sweep follows | Nx postmortem |
| 12 May, 00:12:49 | TanStack advisory GHSA-g7cv-rxg3-hmpx goes public. Nx does not yet know it is affected | Nx postmortem |
| 15 May, 23:56:05 | Attacker returns with the same token using a python-httpx/0.28.1 client, deletes a workflow run | Nx postmortem |
| 16 May, 00:04:07 | Last observed use of the token. Dwell time about 5 days 4 hours | Nx postmortem |
| 18 May, 03:18 | Orphan commit 558b09d7… pushed to nrwl/nx, falsely attributed to a former contributor | StepSecurity |
| 18 May, 12:30 | VS Marketplace accepts 18.95.0. It passes Microsoft's automated checks. Open VSX scan starts | Nx postmortem |
| 18 May, 12:33 | Open VSX scan completes, version goes live | Nx postmortem |
| 18 May, 12:36 | Maintainer receives the routine Marketplace upload email | Nx postmortem |
| 18 May, 12:47–12:48 | Unpublished from VS Marketplace | Nx postmortem |
| 18 May, 13:09 | Unpublished from Open VSX | Nx postmortem |
| 18 May, 13:58 | Nx opens an incident channel and revokes the compromised engineer's access | Nx postmortem |
| 18 May, 17:01 | Nx publishes GHSA-c9j4-9m59-847w | Nx postmortem |
| 18 May (time not public) | GitHub detects and contains the compromised employee device. Critical secret rotation runs "Monday into Tuesday" | GitHub blog |
| 18 May, 20:53 | Microsoft confirms it is responding and shares install telemetry with Nx | Nx postmortem |
| 19 May | TeamPCP lists about 4,000 GitHub repos for sale. GitHub posts on X that it is investigating | The Hacker News, GitHub on X |
| 19 May, 11:14 | Nx Console publishing now needs two-admin approval. Other Nx repos move to npm OIDC trusted publishing | Nx postmortem |
| 20 May | GitHub blog statement by CISO Alexis Wales confirms about 3,800 repos | GitHub blog, SecurityWeek |
| 20 May, 23:46 | Nx updates advisory: impact may be "two orders of magnitude higher" than Marketplace counts | Nx postmortem |
| 21 May | Nx publishes its full postmortem. Data re-listed for sale at $95,000 | Nx postmortem, Flare |
| 26 May | GitHub update: rotating keys including the GHES signing key. GHES admins must act | GitHub blog |
| 29 May | Canadian Centre for Cyber Security issues alert AL26-013 | AL26-013 |
Root Cause
Nx's postmortem names four root causes and adds: "Removing any one would have broken the chain." That framing is the most useful thing in the whole incident, so the rest of this section follows it.
flowchart TD
A["1. Upstream compromise<br/>@tanstack packages poisoned on npm"] --> B["2. Cooldown silently ignored<br/>.npmrc minimum-release-age set,<br/>but pnpm 10.14 did not support it"]
B --> C["3. prepare script runs harvester<br/>on contributor laptop"]
C --> D["4. gh CLI token readable<br/>by any local process"]
D --> E["Attacker acts as contributor<br/>on nrwl GitHub org"]
E --> F["Orphan commit with payload<br/>pushed to nrwl/nx"]
E --> G["5. Single-person publish<br/>no second approval"]
G --> H["Nx Console 18.95.0 on<br/>VS Marketplace + Open VSX"]
H --> I["Auto-update on thousands<br/>of developer machines"]
F --> I
I --> J["Payload harvests tokens<br/>from GitHub employee device"]
J --> K["~3,800 GitHub internal<br/>repositories exfiltrated"]
style A fill:#ff6b6b,color:#fff
style B fill:#cc5500,color:#fff
style D fill:#cc5500,color:#fff
style G fill:#cc5500,color:#fff
style K fill:#ff6b6b,color:#fff
1. The upstream: TanStack
The first link is covered in detail in the TanStack supply chain compromise case study. In short: on 11 May 2026 an attacker chained a pull_request_target workflow, GitHub Actions cache poisoning and OIDC token extraction from runner memory to publish 84 malicious versions across 42 @tanstack/* packages. Those versions carried valid provenance because they were published by TanStack's own release workflow (TanStack postmortem). The malware ran during install via a prepare script and harvested credentials from whatever machine ran it.
2. A cooldown that was configured but not enforced
This is the most instructive detail in the Nx postmortem. The repo the contributor was working in already had a defence against exactly this attack: a package "cooldown" in .npmrc:
# .npmrc — intended: refuse any version younger than 7 days
minimum-release-age=10080
A 7-day cooldown would have blocked a version that was 77 minutes old. But the repo's package.json pinned pnpm through the packageManager field to 10.14, and the minimum-release-age feature arrived in pnpm 10.16. The older pnpm saw a key it did not understand and ignored it without a warning (Nx postmortem).
A control you do not test is a control you do not have
Security settings in config files fail open by default. Unknown keys are ignored by most package managers so that newer config does not break older tools. That is good for compatibility and terrible for security controls. If a setting matters, something must fail loudly when it is not in effect.
3. A CLI token any local process could read
The harvester ran with the contributor's user permissions. The GitHub CLI token was stored in ~/.config/gh/hosts.yml. Nx says it did not determine forensically whether the payload read the file, called gh auth token, or scraped process memory. Whatever the path, the token reached GitHub's API "within 74 seconds of execution."
Nx had an internal practice of wrapping gh through 1Password so the token is not left at rest on disk. It was not enforced, and this machine did not use the wrapper (Nx postmortem).
The attacker's first actions with the token tell you what they were thinking:
- push a malicious commit (adding a secrets-exfiltration workflow with a spoofed bot author, per Nx);
- delete "CodeQL Analysis" workflow runs in bulk, which removes evidence and scan results;
- go quiet for four days, come back once with a different HTTP client, and stop.
4. One person could publish
At the time, any single core contributor could trigger a release of Nx Console to the marketplaces without a second approval (GHSA). Nx's postmortem says only that the upload was "authenticated as the compromised contributor." StepSecurity's analysis says the extension was published with a stolen VSCE_PAT (the Marketplace publishing token) (StepSecurity). The exact route from the GitHub token to the marketplace credentials (for example, running a release workflow that had access to the publish secrets) has not been spelled out publicly. Either way, a single identity was enough to ship.
Nx also wrote, candidly, that its main repositories already used stronger practices and "We failed to apply them more broadly to all of our repos." Nx Console lives in its own repository, nrwl/nx-console, and that repo had not received the same hardening.
5. The payload: hiding in the official repo
The extension change itself was tiny. StepSecurity found about 2.7 KB of code added to the minified main.js, running from the extension's activate() function (StepSecurity). Its job was to start the real payload, not to be the payload.
flowchart LR
A["VS Code opens a workspace"] --> B["Extension activate()"]
B --> C{"globalState marker<br/>already set?"}
C -->|"yes"| Z["Do nothing"]
C -->|"no"| D["Start background task<br/>named install-mcp-extension"]
D --> E["npx fetches package from<br/>orphan commit in nrwl/nx"]
E --> F["npm installs bun runtime<br/>as a normal dependency"]
F --> G["bin entry runs 498 KB<br/>obfuscated payload"]
G --> H["Payload re-spawns detached<br/>parent exits 0"]
H --> I["Harvest credentials,<br/>exfiltrate, persist"]
A few design choices stand out, and each one beat a common defence.
The payload lived in an orphan commit inside nrwl/nx. An orphan commit has no parents and is not reachable from any branch, but GitHub still serves it by SHA. The commit was falsely attributed to a former contributor and was unsigned, while that person's real commits were GPG-signed (StepSecurity). Its commit message was a bluff threatening a "wiper" if it was deleted early. Fetching from github.com/nrwl/nx looks entirely normal to network monitoring, because developers on an Nx project talk to that repository every day.
Why orphan commits are a good hiding place
Most people inspect a repository by looking at branches, tags and pull requests. An orphan commit appears in none of them. GitHub's fork network also means a commit pushed to a fork can sometimes be reached through the parent repository's URL by SHA. Reviewers looking at main see nothing.
It was disguised as MCP setup. The background task was named install-mcp-extension and ran without stealing focus. Extensions installing helper tooling for AI assistants is common in 2026, so the name did not stand out.
No install hooks. The commit's tree held only a package.json (package name nx-next, a bin entry, and a dependency on bun) and an index.js. npm installed bun as an ordinary dependency, then ran the bin entry. Scanners that look for preinstall/postinstall scripts had nothing to flag. npm ci --ignore-scripts in your project would not help either, because this ran from the editor, not your project's install.
Run once, then go quiet. After success, the loader stored the commit SHA in VS Code's globalState so it never ran again, and it swallowed all errors.
Daemonise and exit clean. The payload re-spawned itself as a detached process with the environment variable __DAEMONIZED=1, and the parent exited with code 0. From VS Code's point of view, the task succeeded.
What the payload took
According to the Nx advisory and StepSecurity's analysis, the payload went after essentially every credential a developer machine holds:
| Target | Examples |
|---|---|
| GitHub | ghp_, gho_, ghs_ tokens from files, environment variables and process memory, plus Actions secrets |
| npm | .npmrc tokens, org and package enumeration, OIDC token exchange |
| Cloud | AWS IMDS and ECS metadata, Secrets Manager, SSM Parameter Store, web identity tokens, GCP application-default credentials |
| Secret stores | HashiCorp Vault tokens (including Kubernetes and AWS IAM auth), active 1Password op CLI sessions |
| Local files | SSH keys, .env files, connection strings, Docker config, ~/.claude/ |
| Linux extras | attempted passwordless sudo to add a sudoers rule, scanning /proc/*/mem |
StepSecurity also reported that the payload integrated with Sigstore (Fulcio and Rekor) and SLSA/in-toto tooling. Combined with stolen npm OIDC tokens, that would let an attacker publish packages carrying valid provenance, which is the same property that made the TanStack versions so convincing.
Exfiltration used three independent channels, any one of which was enough: HTTPS to an encrypted C2 domain, the GitHub API (writing commits or artefacts into the victim's own repositories), and DNS tunnelling. Data was compressed and encrypted before sending.
Persistence on macOS was a Python backdoor at ~/.local/share/kitty/cat.py plus a LaunchAgent that ran hourly. It polled GitHub commit search for a marker string, verified an RSA signature on what it found, and ran the referenced code. That design lets the operator push new instructions through public GitHub content, again blending into normal developer traffic. StepSecurity observed at least three cases where this stage failed because the Python requests library was missing, but by then the JavaScript credential theft had already finished. On Windows, the advisory lists a Bun runtime under the user profile and staging files in %TEMP%.
From one laptop to 3,800 repositories
GitHub has not published the path from the infected device to the repositories. What is public: the device belonged to an employee, the extension was the entry point, GitHub's assessment is exfiltration of "GitHub-internal repositories only," and critical secrets were rotated starting the same day. A developer at a company like GitHub typically holds a GitHub token with read access to many internal repositories. Bulk cloning with such a token needs no further exploit. Help Net Security's summary says stolen secrets let the attackers move through CI/CD pipelines, but GitHub's own statement does not say that, so treat it as unconfirmed (Help Net Security).
Detection
What caught what, honestly:
| Detector | What it caught | When |
|---|---|---|
| VS Marketplace "new version" email | A release nobody on the team had built | 6 minutes after upload |
| Microsoft's Marketplace automated scan | Nothing. The version passed | At upload |
| Open VSX pre-publish scan | Nothing. The version passed after a 3-minute scan | At upload |
| A user's GitHub issue (#3139) | The malicious behaviour | Seen by Nx only after the unpublish |
| GitHub's internal detection | Compromised employee device | Same day, mechanism not public |
| Nx's own systems | Nothing. "We did not detect this through any system we built" | — |
| Anyone, for 5 days | The stolen gh token deleting CodeQL workflow runs | Missed |
The most expensive miss was the five-day dwell time of the stolen GitHub token between 11 and 16 May. Bulk deletion of workflow runs is an unusual event. It was in the audit log. Nobody was alerting on it. Nx now monitors the GitHub audit log for exactly this (Nx postmortem).
Indicators you can hunt for
These are the defensive indicators published in the advisory, the postmortem and StepSecurity's write-up. Use them to check machines, not as a complete list.
| Type | Indicator |
|---|---|
| Extension | nrwl.angular-console version exactly 18.95.0 |
| Commit | nrwl/nx commit 558b09d7ad0d1660e2a0fb8a06da81a6f42e06d2, npm cache entries for github:nrwl/nx#558b09d7 |
| macOS / Linux files | ~/.local/share/kitty/cat.py, ~/Library/LaunchAgents/com.user.kitty-monitor.plist, /var/tmp/.gh_update_state, /tmp/kitty-* |
| Windows files | %USERPROFILE%\.local\share\kitty\cat.py, %TEMP%\kitty-*, %TEMP%\.gh_update_state, %USERPROFILE%\.bun\bin\bun.exe |
| Process | python running cat.py, any process with __DAEMONIZED=1 in its environment |
| Linux | unexpected sudoers entries |
| VS Code state | globalState key nxConsole.mcpExtensionInstalledSha set to the malicious SHA |
| Window | 18 May 2026, 12:30–13:09 UTC |
# Is the bad version installed? (VS Code; use `cursor` for Cursor)
code --list-extensions --show-versions | grep -i angular-console
# Persistence artefacts (macOS / Linux)
ls -la ~/.local/share/kitty/cat.py \
~/Library/LaunchAgents/com.user.kitty-monitor.plist \
/var/tmp/.gh_update_state /tmp/kitty-* 2>/dev/null
# Running daemon (Linux: check process environments)
grep -l '__DAEMONIZED=1' /proc/*/environ 2>/dev/null
pgrep -fl 'kitty/cat.py'
# Did npm ever fetch the orphan commit?
grep -rl '558b09d7' ~/.npm/_cacache/index-v5 2>/dev/null
# Windows
Test-Path "$env:USERPROFILE\.local\share\kitty\cat.py"
Test-Path "$env:TEMP\.gh_update_state"
Test-Path "$env:USERPROFILE\.bun\bin\bun.exe" # only suspicious if you never installed Bun
Get-ChildItem "$env:TEMP" -Filter "kitty-*" -ErrorAction SilentlyContinue
Select-String -Path "$env:LOCALAPPDATA\npm-cache\_cacache\index-v5\*\*\*" -Pattern "558b09d7" -List -ErrorAction SilentlyContinue
Response
Nx
From the postmortem and advisory (Nx postmortem, GHSA):
- Unpublished
18.95.0from both marketplaces (12:47 and 13:09). - Opened an incident war room and revoked the compromised engineer's access (13:58).
- Published the GitHub security advisory (17:01) and pushed notices on X, Discord and directly to users.
- Rotated tokens and added deployment protection rules to release workflows (from 18:47).
- Worked with Microsoft on install telemetry.
- Required two-admin approval for Nx Console publishing, and moved other repos to npm OIDC trusted publishing (19 May).
- Shipped
18.100.0as the clean version and published a full postmortem (21 May), with Windows indicators added on 22 May.
GitHub
From GitHub's statement (GitHub blog):
- Removed the malicious extension version, isolated the endpoint and began incident response.
- Rotated critical secrets "Monday into Tuesday," prioritising the highest-impact credentials.
- Continued log analysis, verification of the rotation and monitoring for follow-on activity.
- On 26 May, "out of an abundance of caution," rotated keys including the GitHub Enterprise Server signing key, which signs GHES upgrade packages. GitHub stated "All binaries hosted by GitHub are valid."
The signing key rotation is the part that reached customers. A GHES appliance verifies upgrade packages against a GPG public key it already holds. After the rotation, an appliance with the old key will reject new packages with Error: The file provided is not a valid GitHub Enterprise Server package. GitHub published a rotation script (https://enterprise.github.com/security/2026-05-24/rotate-gpg.sh) with a published SHA-256, to be run once as the admin user and once with sudo, because the key lives in both accounts. On HA and clustered deployments it is run through ghe-cluster-each. GitHub Enterprise Cloud customers needed to do nothing.
Why rotate a key that was not proven stolen
If an attacker copied internal repositories, any secret that might have been in them, or reachable from the machines involved, has to be treated as exposed. A code-signing key is the worst case: with it, an attacker could sign a malicious upgrade that customer appliances would trust. Rotating it costs every GHES admin a few minutes. Not rotating it, if it had been exposed, could cost every GHES install. That asymmetry is why "rotate on suspicion" is the right default for signing keys.
Government guidance
The Canadian Centre for Cyber Security's alert AL26-013 (29 May) told organisations to remove 18.95.0 everywhere, check for the cat.py persistence, and "immediately rotate all credentials (AWS, GCP, Azure, GitHub, npm) exposed on developer machines between May 11–20, 2026." It also recommended turning off IDE extension auto-updates in high-security environments and enforcing an allowlist of approved developer tools, and reviewing CI/CD logs for unexpected cloning, admin actions and "rogue pushes or orphan commits" (AL26-013).
Remediation (if you were exposed)
If any machine you are responsible for had Nx Console 18.95.0, the advisory's order of operations is correct:
- Update the extension to
18.100.0or later so the loader stops. - Kill the processes (
cat.py, anything with__DAEMONIZED=1). They may be actively exfiltrating. - Remove persistence. On macOS,
launchctl unloadthe plist before deleting it, orlaunchdkeeps it loaded. - Rotate everything the machine could reach, not only what was on disk. The payload read process memory and active 1Password sessions. That includes GitHub tokens and SSH keys, npm tokens, cloud keys and roles, Vault tokens, Kubernetes credentials, GitHub Actions secrets the user could read, and AI/MCP API keys.
- Review audit logs in GitHub, npm, cloud providers, Vault, 1Password and Sigstore (Rekor) for activity from those identities since 11 May.
- Do not trust provenance alone on packages your identities published during the window. Inspect contents.
- Reimage sensitive machines after rotation. Updating the extension does not remove the persistence.
What Would Have Prevented It
Each link in the chain had a cheap, well-known control. Here they are in chain order.
1. A cooldown that actually runs
Nx's own recommendation: pin pnpm to 10.16 or later and add a guard that fails when it is older. The setting itself:
# pnpm-workspace.yaml (pnpm >= 10.16)
minimumReleaseAge: 10080 # minutes, 7 days
minimumReleaseAgeExclude:
- "@your-org/*" # your own packages can skip the wait
// package.json — pin a pnpm version that understands the setting
{
"packageManager": "pnpm@10.16.0"
}
And a check that makes the control fail closed:
#!/usr/bin/env bash
# ci/check-pnpm-version.sh — fail if pnpm cannot enforce minimumReleaseAge
set -euo pipefail
required="10.16.0"
actual="$(pnpm --version)"
if [ "$(printf '%s\n%s\n' "$required" "$actual" | sort -V | head -n1)" != "$required" ]; then
echo "pnpm $actual is older than $required: minimumReleaseAge would be silently ignored" >&2
exit 1
fi
Run it in CI and as a preinstall hook in your own root package.json, so local installs on an old pnpm also stop. A 7-day cooldown alone would have kept the 77-minute-old TanStack version off the contributor's laptop.
2. No install scripts from dependencies by default
The harvester ran from a dependency's prepare script. pnpm 10 already blocks dependency lifecycle scripts unless you allow them. Keep it that way and allowlist explicitly:
# pnpm-workspace.yaml
onlyBuiltDependencies:
- esbuild
- "@swc/core"
# everything else: lifecycle scripts do not run
For npm:
npm ci --ignore-scripts
npm config set ignore-scripts true # per-user default on developer machines
This would have stopped the first link. It would not have stopped the extension's loader, which ran from the editor, so it is necessary but not sufficient.
3. No long-lived tokens at rest on laptops
A CLI token in a plaintext file is readable by every process running as you. Options, from least to most effort:
# Prefer the OS keyring (the default in current gh releases when a keyring is available)
gh auth login --hostname github.com --git-protocol https
gh auth status # shows where the token is stored
# Avoid --insecure-storage, which writes the token to hosts.yml in plaintext
Better: inject short-lived tokens just in time from a secret manager, so nothing is at rest. Nx's internal practice was a 1Password wrapper; the 1Password CLI's shell plugin does this:
# Token stays in 1Password, released per-invocation (requires biometric unlock)
op plugin init gh
gh repo list my-org # gh now runs through `op`, no token on disk
Best: use fine-grained, short-expiry tokens scoped to the repositories a person actually works on, and enforce SSO plus token expiry at the organisation level so a stolen token has a small blast radius and a short life. Note the honest limit: the payload also scraped process memory and live 1Password sessions. Keyrings raise the bar; they do not make a compromised user session safe. That is why the next controls matter.
4. Two-person publishing with no stored publish secret
The release should not be something one identity can trigger. On GitHub, put the publish job behind an environment with required reviewers and prevent self-review:
# .github/workflows/release-extension.yml
name: release-extension
on:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<full-40-char-commit-sha> # v4.x, pin by SHA
- run: npm ci --ignore-scripts
- run: npx @vscode/vsce package -o ext.vsix
- uses: actions/upload-artifact@<full-40-char-commit-sha> # v4.x
with: { name: vsix, path: ext.vsix }
publish:
needs: build
runs-on: ubuntu-latest
environment: marketplace # required reviewers + "Prevent self-review" enabled
steps:
- uses: actions/download-artifact@<full-40-char-commit-sha> # v4.x
with: { name: vsix }
- run: npx @vscode/vsce publish --packagePath ext.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }} # environment secret, only visible after approval
Configure the environment in Settings → Environments → marketplace: add at least two required reviewers, enable Prevent self-review, and restrict deployment branches to main or release tags. Store the publish token as an environment secret, not a repository secret, so no other workflow can read it.
Where the registry supports it, go further and remove the stored token entirely. npm and PyPI support OIDC trusted publishing: the registry trusts a specific repository and workflow, and each run gets a short-lived token. Nx moved its npm packages to this (Nx postmortem). For the VS Marketplace, Microsoft supports publishing with a Microsoft Entra identity instead of a PAT; check current documentation for your setup.
Provenance is not a substitute for review
TanStack's malicious versions had valid provenance, because the attacker ran code inside the legitimate release workflow. Provenance proves where something was built. It does not prove who intended it. A human approval gate is what proves intent.
5. Pin action SHAs and watch the audit log
Nx pinned all GitHub Actions to commit SHAs after the incident (as in the workflow above). Equally important is alerting on the things this attacker did with the stolen token. With the GitHub audit log streaming to your SIEM, alert on at least:
| Audit event | Why |
|---|---|
workflows.delete_workflow_run in bulk | The attacker deleted CodeQL runs to hide evidence |
workflows.prepared_workflow_job with an unexpected actor | Release or publish jobs triggered by someone who does not normally ship |
git.push by an identity outside its normal repos or hours | Payload commits such as the orphan commit in nrwl/nx |
git.clone volume per token above baseline | Bulk exfiltration of repositories |
oauth_access.create / personal_access_token.* from new IPs or user agents | Reuse of a stolen token, e.g. python-httpx from a contributor who never uses it |
A minimal check you can run today with the REST API (organisation audit log requires an Enterprise plan):
# Workflow run deletions in the last 7 days
gh api -X GET "/orgs/YOUR_ORG/audit-log" \
-f phrase='action:workflows.delete_workflow_run created:>=2026-11-02' \
-f per_page=100 --paginate \
--jq '.[] | [.created_at, .actor, .repo] | @tsv'
6. Control which editor extensions can run
The extension marketplace is a package registry with auto-update turned on by default and no lockfile. Treat it like one.
VS Code supports an allowlist through the extensions.allowed setting, which organisations can enforce through device management policy (Group Policy on Windows, configuration profiles on macOS). You can allow publishers, specific extensions and specific versions:
// Enforced via policy; shown here as settings.json for readability
{
"extensions.allowed": {
"ms-python": true, // whole publisher
"dbaeumer.vscode-eslint": true, // one extension
"nrwl.angular-console": ["18.94.0"], // pin to a reviewed version
// anything not listed is blocked once this setting is present
},
"extensions.autoUpdate": false, // updates go through review
"extensions.autoCheckUpdates": false
}
Version pinning turns an extension update into a reviewed change, the same as a dependency bump. Combined with a short delay (for example, approve versions only after they have been public for a few days), it would have kept 18.95.0 off managed machines entirely. AL26-013 recommends exactly this: disable auto-update in high-security environments and allowlist approved tools.
Remember that forks of VS Code (Cursor, Windsurf and others) use Open VSX or their own marketplaces and may not honour the same policies. If your engineers use them, you need an equivalent control for each editor, or a policy that only managed editors are allowed.
7. Egress controls on developer machines
The loader used npx to fetch from GitHub, which you cannot block. But the payload also needed to reach a C2 domain, fetch the Bun installer, call cloud metadata endpoints that do not exist on a laptop, and send DNS queries with encoded data. An endpoint firewall or secure web gateway with default-deny for unusual destinations, plus DNS monitoring for high-entropy subdomains, raises the cost of every one of those steps.
A cheap, high-signal detection: developer laptops have no reason to call 169.254.169.254 (cloud instance metadata). Any process doing so on an endpoint is suspicious:
# Example Sigma-style rule (adapt to your EDR)
title: Cloud metadata endpoint access from a workstation
logsource:
category: network_connection
product: macos # also windows, linux
detection:
selection:
DestinationIp:
- 169.254.169.254
- 169.254.170.2
condition: selection
level: high
8. Make the laptop hold less
The deepest fix is architectural: a developer machine should not hold credentials that can read thousands of repositories, publish packages and reach cloud production all at once.
- Use cloud development environments or isolated containers for working on third-party code, so
pnpm installin someone else's repo cannot read your main credentials. - Separate read identities from publish identities. Day-to-day work should never have publish rights on its own; publishing goes through CI with approval.
- Use device trust: tokens that are bound to a managed, healthy device and expire quickly (GitHub supports SSO with conditional access through identity providers).
- Keep signing keys in HSMs or KMS, never somewhere a laptop or an internal repository could reach them, so the response to an internal leak is not a customer-facing key rotation.
Lessons for System Design
1. The developer endpoint is part of production. Every credential a laptop holds is part of your attack surface, and every tool that runs on it, including editor extensions, package scripts and AI assistants, runs with those credentials. Design the endpoint the way you design a production host: least privilege, short-lived credentials, allowlisted software and monitored egress.
2. Supply chain attacks now chain across organisations. TanStack's CI was compromised to steal an OIDC token. That release stole a contributor's token at Nx. That token shipped an extension that reached GitHub. Grafana Labs was hit by the same TanStack wave separately (Help Net Security). When you assess your exposure to an upstream incident, ask not only "did we install the bad package?" but "did anyone we depend on install it?"
3. Controls must fail closed and be tested. The minimum-release-age setting would have stopped this attack. It was configured. It was silently ignored by an older tool. Any security setting that is only declared in a config file needs a check that proves it is in force.
4. Count your single points of approval. "Removing any one would have broken the chain." The publish step was the last point where a second human could have stopped it. Two-person rules for releases are cheap compared with what one stolen identity can do without them.
5. Every registry with auto-update is a deployment pipeline you do not control. Extension marketplaces push code to your machines on someone else's schedule. Pinning, allowlisting and cooldowns are to editor extensions what lockfiles and canary deploys are to services.
6. Watch your audit logs for anti-forensics. The token was used for five days. Its first moves (deleting CodeQL workflow runs) were attempts to destroy evidence. Deletions of security-relevant records are among the highest-signal alerts you can write.
7. Plan the customer-facing rotation before you need it. GitHub's GHES signing key rotation required every customer appliance to run a script. Design signing infrastructure so keys can be rotated with a published, verifiable procedure, and keep them where an internal source-code leak cannot reach them.
8. Trust your weak signals. The thing that caught the release was a routine email to a maintainer. Notifications about releases, new tokens, new deploy keys and new OAuth grants are cheap detection. Route them to people who will notice "I did not do that."
What Would You Do?
Scenario 1: You lead platform security. The TanStack advisory lands at 00:12 UTC on 12 May. Your dependency scanning says none of your repositories use `@tanstack/zod-adapter`. Are you done?
No. Your repositories are not the only place packages get installed. Engineers run pnpm install in side projects, open-source contributions and interview exercises on the same laptop that holds their work credentials. The Nx contributor was infected from a repository outside the nrwl organisation. The right move is to ask engineers (or query EDR and package-manager caches) whether any machine installed an affected version anywhere, and to rotate the credentials of any machine that did. Nx did not realise it was affected until a week later, after the extension had shipped.
Scenario 2: At 12:36 UTC you get an email saying version 18.95.0 of your extension was uploaded. Nobody on the team cut a release. What do you do in the next 15 minutes?
Unpublish first, investigate second. Every minute it stays live, more machines auto-update. Unpublish from every registry you publish to, not just the one that emailed you (Open VSX stayed live 21 minutes longer than the Marketplace). Then revoke the publishing credentials and the access of whichever identity performed the upload, and publish an advisory with the exact version and window, even before you know the payload. Users need the version number to check their machines.
Scenario 3: You are GitHub. An employee's laptop had the extension. You do not yet know what the attacker took. Which secrets do you rotate first?
Rotate in order of blast radius. First, anything that can change what customers run: code-signing keys and release credentials. Then credentials that grant broad access: the employee's tokens, SSO sessions and any automation tokens reachable from the device. Then secrets that might be stored in internal repositories the employee could read. GitHub described rotating "the highest-impact credentials first" and later rotated the GHES signing key as a precaution. Rotating a signing key causes customer-facing work, but an attacker holding it could sign a malicious upgrade, so the trade is clearly worth it.
Scenario 4: Your CTO wants to ban VS Code extensions entirely. Is that the right response?
Probably not, and it would not hold. Engineers will install what they need to work, and banning everything pushes them to unmanaged editors with no controls. A better response is an allowlist of reviewed extensions enforced by policy, pinned versions with auto-update off, a short review delay for new versions, and a separate fast path for engineers to request additions. Pair that with reducing what a compromised extension can reach: short-lived tokens, no publish rights on laptops, and egress monitoring.
Key Lessons
- Developer laptops are production. An editor extension runs with every credential the engineer holds.
- A configured control is not an enforced control. Nx's 7-day cooldown was in
.npmrcand silently ignored by an older pnpm. - Two people should be needed to ship. Single-identity publishing turned one stolen token into a malicious release.
- Extension marketplaces need lockfiles too. Use
extensions.allowed, pin versions, turn off auto-update for managed fleets. - Alert on anti-forensics. Bulk deletion of CodeQL workflow runs went unnoticed for five days.
- Rotate signing keys on suspicion. GitHub rotated the GHES signing key without proof it had been taken, because the downside of not doing so was unbounded.
Quiz
Q1: How did the attacker obtain the ability to act as an Nx contributor?
On 11 May an Nx contributor ran pnpm install in an unrelated repository that resolved a compromised @tanstack/zod-adapter version. Its prepare script ran a credential harvester that obtained the contributor's GitHub CLI OAuth token, which was used against GitHub's API within 74 seconds.
Q2: Why did the repository's 7-day minimum-release-age setting not stop the install?
The repository pinned pnpm 10.14 via packageManager, and the setting was only supported from pnpm 10.16. The older pnpm ignored the unknown key without warning, so the 77-minute-old malicious version was installed.
Q3: Why did hosting the payload in an orphan commit in nrwl/nx help the attacker?
An orphan commit is not reachable from any branch, so it does not show up in normal repository browsing or pull requests, but GitHub still serves it by SHA. Fetching from the official nrwl/nx repository also looks like normal developer traffic, so network monitoring is unlikely to flag it.
Q4: Why would npm ci --ignore-scripts in your own project not have protected you from the extension's payload?
The loader ran from inside VS Code when a workspace opened, not from your project's install. It used npx to fetch the payload package, whose code ran through a bin entry rather than an install hook. Install-script controls stop the first link (the TanStack prepare script) but not this one.
Q5: Why did GitHub Enterprise Server administrators have to act, even though GitHub said customer data was not affected? GitHub rotated the key it uses to sign GHES upgrade packages as a precaution. GHES appliances verify upgrades against the public key they hold, so each appliance had to install the new key using GitHub's script, or future upgrades would fail verification.
Q6: Why is there a disagreement between "28 installs" and "about 6,000"?
28 is Microsoft's Marketplace install count. About 6,000 is Nx's own telemetry count of extension activations of 18.95.0 within two days. The two measure different things, and the gap had not been fully explained publicly; Nx said it was reconciling the numbers with Microsoft.
Related Pages
- TanStack Supply Chain Compromise (May 2026) — the upstream incident that started this chain
- Axios Supply Chain Attack (March 2026) — a stolen maintainer token, same lesson about long-lived publish credentials
- LiteLLM Supply Chain Attack (March 2026) — earlier TeamPCP campaign, CI token theft via an unpinned action
- XZ Utils Backdoor (2024) — trust in maintainers as an attack surface
- SolarWinds — build pipeline compromise reaching thousands of customers
- Supply Chain Security — SLSA, provenance, SBOMs
- Secrets in CI/CD — keeping publish credentials out of reach
- Secret Rotation Automation — rotating fast when you need to
- GitHub Actions Deep Dive — environments, OIDC and permissions
- Device Trust — binding credentials to managed devices
- Least Privilege — making a stolen token worth less
- Audit Logging — the logs that would have caught the five-day dwell time
- Incident Response Playbook — the first hours of a response like Nx's
One-Liner Summary
A credential stolen by a poisoned TanStack package let an attacker ship a malicious Nx Console update that was live for 18 minutes, and one GitHub employee's auto-updating editor was enough to walk out with about 3,800 of GitHub's internal repositories.
Sources
Primary
- GitHub Blog — Investigation update: GitHub Enterprise Server signing key rotation (originally "Investigating unauthorized access to GitHub's internal repositories"), Alexis Wales, 20 May 2026, updated 26 May 2026
- GitHub on X — initial investigation notice, 19 May 2026
- Nx — Postmortem: Nx Console v18.95.0 supply-chain compromise, 21 May 2026
- GHSA-c9j4-9m59-847w — Compromised Nx Console version 18.95.0 (CVE-2026-48027)
- Canadian Centre for Cyber Security — AL26-013 Security incident impacting GitHub internal repositories, 29 May 2026
- TanStack — Postmortem: TanStack npm supply-chain compromise
Security research
- StepSecurity — Nx Console VS Code Extension Compromised
- Flare — Supply Chain Ransomware: TeamPCP Weaponizes Worms to Fuel Partnerships and $95K Data Sales
Reporting
- SecurityWeek — GitHub Confirms Hack Impacting 3,800 Internal Repositories
- The Hacker News — GitHub Breached: Employee Device Hack Led to Exfiltration of 3,800+ Internal Repos
- The Hacker News — GitHub Internal Repositories Breached via Malicious Nx Console VS Code Extension
- Help Net Security — GitHub, Grafana Labs breaches traced back to TanStack supply chain compromise, 21 May 2026