Podcast about DevSecOps

#97 - Shift Left, Get Hacked: Supply Chain Attacks Hit Devs

A routine package install can expose SSH keys and cloud credentials before code reaches CI.

18 min read

March 2026 made supply chain attacks feel a lot less theoretical, but what made these incidents different? The hosts discuss compromised publishing credentials, automatic execution hooks like post-install scripts and Python .pth files, and how both humans and security tools caught the malicious releases. They also talk through concrete ways to make developer environments harder to abuse.

Discuss the episode or ask us anything on LinkedIn


The compromise moved in front of the gate

The supply chain risk most teams build for has one shape. A bad library gets into your application, your build ships it, and it sits in production until something notices. That shape is why the gates live in CI: scan the image, scan the dependencies, fail the build on the finding.

It has never been the only shape. Codecov’s 2021 security update described a modified Bash uploader that exported the environment variables of its customers’ CI jobs to a third-party server, credentials taken inside the pipeline with nothing shipped to production at all. March 2026 made the same point twice in a month, and made it on developer machines. Malicious code collected SSH keys, cloud credentials and Kubernetes tokens and called home, in one case from an npm install hook, in the other from a file Python executes at interpreter startup. By the time a scanner looks at the artifact, the credentials are already gone.

We have spent a decade telling everyone to shift left. The people attacking us shifted further, and they got there first. Both incidents are worth walking through because of where they started. One began inside a security scanner, the tool whose whole job is catching this. The other began with the account of a maintainer whose package you install without thinking, around 100 million times a week. Neither would have been caught by the reputation checks we have recommended since 2022: the stars, the maintainer, the name, the download counts.

A security scanner was the first domino

Start with the order of events, because the order is the whole story.

How does a compromised GitHub Action end up as a malicious package on PyPI?

The scanner runs inside other people’s pipelines, and it leaves with their publishing credentials.

Aqua Security’s Trivy was the entry point. An actor got in through a misconfigured pull_request_target workflow in late February 2026, and Aqua disclosed the incident on March 1 and started rotating credentials. That rotation left a gap. Quoting Aqua’s own post-incident analysis, it “wasn’t atomic and attackers may have been privy to refreshed tokens.” Nobody has established that the new credentials were taken. What is established is that the actor, tracked as TeamPCP, still held credentials that worked. From 17:43 UTC on March 19, the first suspicious entry in Aqua’s audit log, it force-pushed 76 of 77 release tags in aquasecurity/trivy-action and all seven tags in aquasecurity/setup-trivy to malicious commits. The exposure ran about twelve hours, to roughly 05:40 UTC on March 20, and about four hours for setup-trivy. GitHub’s advisory, GHSA-69fq-xp46-6x23, scores it 9.4.

The tags moved. trivy-action released under unprefixed tags, so a workflow pinned to uses: aquasecurity/trivy-action@0.34.0 pointed at a malicious commit with nothing changed in your repository. Every tag from 0.0.1 to 0.34.2 was affected; 0.35.0 was not, because GitHub’s immutable releases held it. A tag is a pointer, and whoever holds the credentials can move it, so pin by commit SHA instead. That is not sufficient on its own: the advisory lists SHA-pinned trivy-action commits that stayed exposed, because a commit from before April 9, 2025 reached the nested setup-trivy action by tag, and that tag moved under it. Pin to a commit the advisory marks safe, then read what the commit pulls in. The force-pushed names cannot be re-created, so Aqua republished the legitimate commits with a v prefix: in your workflow the fix is @v0.34.0 rather than @0.34.0.

LiteLLM ran Trivy in its own pipeline. The poisoned action took the PyPI publishing token out of the runner environment, and on March 24 two malicious LiteLLM releases went up: 1.82.7 at 10:39 UTC and 1.82.8 thirteen minutes later. LiteLLM is a gateway that lets you point one API at several model providers, and Trend Micro puts it at 3.4 million downloads per day. PyPI quarantined the versions roughly three hours after publication.

The payload went for the machine, not the product

Three hours sounds like a fast response until you look at what the package did in the first second.

What did the malicious LiteLLM release actually take?

Everything on disk that looked like a credential, and then it stayed.

Trend Micro describes a three-stage payload: a credential harvester targeting over 50 categories of secrets, a Kubernetes lateral movement toolkit, and a persistent backdoor. Datadog’s analysis gets specific about the inventory: environment variables, SSH keys, cloud credentials, Kubernetes data, Docker configs, encrypted and shipped to models.litellm[.]cloud. It wrote ~/.config/sysmon/sysmon.py, installed a user systemd unit called sysmon.service, polled an attacker-controlled URL for whatever came next, and created privileged node-setup-* pods when it found a usable Kubernetes service-account token.

The delivery mechanism in 1.82.8 is the part worth learning. The wheel shipped a 34,628-byte file called litellm_init.pth. Python’s site module executes import-prefixed lines in a .pth file, the ones that begin with import, when it processes that environment’s site-packages at startup, so nothing has to import LiteLLM. Install it into an environment, and every interpreter that starts normally against that environment runs the payload. An environment that doesn’t process the affected site-packages won’t trigger this hook, and python -S skips site processing altogether. Import isolation isn’t containment, though: the payload runs with your user’s permissions, and a venv created with --system-site-packages reads the affected directory anyway. That is a different shape from an npm postinstall hook, which fires once during the install and is then done.

The bug was a fork bomb. The launcher spawned child Python processes, each child re-triggered the .pth, and on March 24 production systems running LiteLLM started dying with runaway processes, CPU pegged at 100%, and containers killed by out-of-memory errors. Detection did happen, and fast: Sonatype’s automated analysis flagged and blocked the malicious releases within seconds of publication. What the crash added was attention. Trend Micro says the bug “is what triggered the analysis,” and its own route in was a researcher testing a Cursor MCP plugin that pulled LiteLLM in as a transitive dependency.

Taking over the maintainer beats breaking the code

The second incident needed no poisoned CI at all, and it retires advice we gave in 2022.

Why don’t the usual package checks catch this?

Because the name, the account and the download counts are all the real ones, and only the publishing credentials changed hands.

On March 31, between 00:21 and 03:20 UTC, an attacker added a dependency called plain-crypto-js to axios 1.14.1 and 0.30.4. Google Threat Intelligence Group found that the lead maintainer’s npm account had been compromised and its email changed to an attacker-controlled Proton address. The new dependency carried a postinstall hook running node setup.js, which branched by operating system, pulled down a platform-specific remote access trojan GTIG tracks as WAVESHAPER.V2, and beaconed every 60 seconds. GTIG attributes it to UNC1069, a financially motivated North Korea-nexus actor active since at least 2018.

Then it cleaned up. Huntress documents the sequence: the script deletes itself, deletes the package.json that holds the postinstall hook, and renames a stashed package.md over it. That removes the evidence of how it ran, not the compromise itself. Huntress still lists the plain-crypto-js directory, the downloaded payload, its persistence and the beacon traffic as things you can find.

So the checklist of stars, maintainer reputation, typo-squatted names and download counts does nothing here. Those checks assume the bad package is new or obscure. When the attacker holds publishing credentials for a package with 100 million weekly downloads, every signal says fine.

Signing is the tempting answer, and three separate mechanisms go by that name. Registry signatures are integrity: the registry signs name@version:integrity with its own key, which catches a tampered mirror. Trusted publishing is authentication: an OIDC exchange proves which CI workflow is asking to publish, so no long-lived token is needed. A provenance attestation links the published artifact back to its source repository and build instructions, and npm audit signatures counts those separately. None of the three reads the code. npm says so itself: provenance “does not guarantee the package has no malicious code.”

axios had the authentication part, trusted publishing on its v1.x branch. It did not help. Huntress found that the attacker published directly with the npm CLI using a long-lived access token, and that the workflow still passed NPM_TOKEN as an environment variable alongside the OIDC credentials. When both are present, npm uses the token. Adding trusted publishing does not retire the old token. You have to delete it.

npm runs it at install, Python runs it at startup

Both payloads needed something to execute them, and they got it from two different places. npm ran the axios dropper during the install. Python ran the LiteLLM payload at interpreter startup, which is not a package manager behaviour at all and does not switch off like one.

Can I stop packages from running install scripts automatically?

For npm, yes, and it is one line of config.

Set ignore-scripts=true in .npmrc, or pass npm install --ignore-scripts. It defaults to off, which is the wrong default for most people reading this. Read the scope narrowly, though: the setting stops lifecycle scripts a package asks npm to run on your behalf, and npm’s config reference notes that commands whose whole job is running a script still run one. It is a lock on postinstall, not on code you asked to execute.

pnpm made the better default: v10.0.0, released January 7, 2025, stopped running dependency lifecycle scripts unless you allowlist the package, through onlyBuiltDependencies or pnpm approve-builds. If you stay on npm out of habit rather than constraint, that is a real argument for moving.

Python is where this advice runs out. pip has no equivalent switch that covers the LiteLLM case, because there was no install-time hook to disable. The malicious code was not in a setup.py that only source distributions run; it was a .pth file inside a wheel, executed by the interpreter itself at startup. Installing only built wheels does not help you, and neither does declining to import the package.

That leaves the dependencies you never chose. An MCP server you launch with npx or uvx brings its own tree, and the two get there differently. When no matching local package or executable is available, npx goes back to the registry for a bare package name, even when a copy is already sitting in its cache: npm’s libnpmexec skips the early cache hit for a name without a version, fetches the manifest with preferOnline, and installs the newer release when the resolved tarball differs. So an unpinned npx line can fetch a release published an hour ago on a run that was clean yesterday. uvx builds a tool environment on first use and then reuses it from cache, so resolution happens on that first run, and again when you refresh it. The risky moment is the resolution: anything unpinned gets whatever is newest right then. No install-script setting helps with what happens after it, because running the server is the whole point, and the package’s own code executes by design. Most of us have a few of those lines in a config file, pointing at packages we have never read.

Waiting is the cheapest control you have

If you cannot always stop the code from running, change when you fetch it.

How long should I wait before installing a new version?

Long enough for someone else to find the problem, and a week is a sensible default.

npm has shipped this. Put min-release-age=7 in your .npmrc and npm builds the tree from versions that have been available for more than seven days. The value is in days and the default is null; the older before flag does the same job with an absolute date. Both are in npm’s config reference. Check your version before you rely on it: the option arrived in npm 11.10.0, released February 11, 2026. pnpm’s equivalent is minimumReleaseAge, set in minutes, added in pnpm 10.16.0 in September 2025.

The timeline is why it works on these two incidents. The LiteLLM versions were quarantined about three hours after publication. On the axios side, Huntress clocks the malicious plain-crypto-js dependency being flagged as malware at 00:05:41, about sixteen minutes before the poisoned axios versions went up at 00:21:58. Detection was ahead of the attack and the attack landed anyway: the first infection on an endpoint Huntress monitors came at 00:23:27, 89 seconds after publication. A verdict in a vendor’s feed is not a block on your laptop. Waiting is.

The same logic applies to your bots, and Dependabot does two different jobs here. Its security updates are advisory-driven, so they can only move you off a bad version once someone has published an advisory for it. The version updates wait for nothing: they follow whatever the registry has released, which is how a bot opens the pull request that pulls in a version published an hour ago. With auto-merge on, that is a delivery mechanism with a corporate logo. Set a cooldown there too, and keep lockfiles committed so npm ci installs what you reviewed.

This is the one point where we don’t agree. Paulina would put an internal proxy in front of the registry, Nexus or Artifactory, serving only approved versions. Mattias doesn’t think human approval queues survive contact with reality: it is slow, and the person clicking approve has no way to know what they are approving. Both are true, which is why the version age gate is worth more than the review step attached to it.

Stop keeping the keys on the laptop

Everything above lowers the odds of running the code. This lowers what the code gets when it runs anyway.

What do these payloads find on a developer machine?

Whatever is sitting in a file: private SSH keys, static cloud credentials, kubeconfigs, Docker configs, and the environment variables of whatever shell started the install.

So take those off the disk. Keep SSH keys in the Secure Enclave with something like Secretive, or in 1Password’s SSH agent, and then go and set the approval policy. 1Password authorizes a session, and later commands inside it can use the key without prompting again unless you configure per-request approval. The agent keeps the key off the disk; the approval policy is what stops a process on your machine from using it quietly. Use short-lived cloud credentials through SSO, or a tool like aws-vault, instead of long-lived keys parked in ~/.aws/credentials. Keep production credentials out of the developing environment, which everyone nods at and few environments pass.

Then make rotation something you can do on a bad Tuesday. We have been through a rotation of 500 passwords and tokens where nothing was documented about how, and it took weeks, mostly because of the external parties who had to be told. That is the real cost of a compromised laptop: not the incident, the inventory.

Isolate what you can’t review

The last control assumes the first four failed, which is the right assumption to build on.

What actually contains a credential stealer that already ran?

A boundary it cannot read through, which makes the boundary only as good as what you mounted into it.

Dev containers with short-lived tokens are the practical version of that. Install into the container, run the agent in the container, throw the container away when something looks wrong. How much that buys you depends on what you wired in. A bind-mounted home directory, a mounted ~/.aws, or an SSH agent forwarded in by your editor puts the host’s credentials back inside reach, and VS Code forwards the agent on purpose so Git operations keep working. Deleting the container undoes nothing that already left: tokens that were read still have to be revoked. Keep the mounts thin and the tokens scoped. The container limits what gets taken, it does not take anything back. Setting one up used to be a chore. Now the coding tool next to you writes the config while you watch.

Network filtering helps at the edges, with one caveat. A plain VPN is a tunnel and will not notice any of this. A resolver that blocks known-bad domains, NextDNS or Cloudflare WARP with filtering on, can break the call home. But the LiteLLM exfiltration domain was registered one day before the release, so reputation lists may not have had it yet. Treat it as a layer that sometimes catches the attack, not one that decides the outcome.

The same question applies to the automation pointed at your repositories. If an LLM code reviewer runs on incoming pull requests, the diff is untrusted input going into something that holds a GitHub token that may grant access to other repositories. Crafted instructions in a code comment are the cheapest way in. Scope the token to that repository.

What this means for teams

The reputation checks we gave in 2022 no longer cover the attacks of 2026. Stars, maintainer history and download counts all read clean when the malicious release goes up under the legitimate package name with compromised publishing credentials. The malicious changes were there to find, an added plain-crypto-js dependency in axios and a .pth file in the LiteLLM wheel, but seeing them means reading the diff of a patch release before it installs. Short of that, what you control is when you fetch, whether fetched code gets to run, what it finds, and how far it gets.

None of this requires a budget or a platform team. Four things this week:

  • Put a cooldown on your package manager and your update bot: min-release-age=7 in .npmrc on npm 11.10.0 or newer, minimumReleaseAge on pnpm 10.16.0 or newer, and a cooldown on Dependabot’s version updates.
  • Turn off automatic install scripts where you can. ignore-scripts=true for npm, or move to pnpm and allowlist the handful of packages that genuinely need a build step.
  • Get the static credentials off developer disks. SSH keys into an enclave or 1Password with per-request approval turned on, cloud access through SSO with short-lived sessions, no production keys in a dev environment.
  • Write the rotation runbook before you need it, listing every credential reachable from a laptop and the command that replaces it, including the ones held by people outside your company.

Common questions, answered

How do I check whether we installed the compromised axios or LiteLLM versions?

Grep your lockfiles and installed trees. On the npm side, search package-lock.json, yarn.lock and pnpm-lock.yaml for axios 1.14.1 and 0.30.4, and for plain-crypto-js: Huntress treats a node_modules/plain-crypto-js/ directory as evidence on its own, since the dropper renames a clean manifest over its tracks.

On the Python side, look for LiteLLM 1.82.7 and 1.82.8, then for litellm_init.pth in site-packages, ~/.config/sysmon/sysmon.py, and a user unit named sysmon.service. Check CI runners and images too.

What do we rotate after a machine ran one of these packages?

Isolate the machine first, then rotate from a clean one. The LiteLLM payload left a persistent backdoor, so a replacement credential typed into it goes straight back to the attacker: take it off the network, revoke and reissue elsewhere, and keep the new secrets off it until it is rebuilt.

Rotate everything that machine could read: SSH keys, cloud credentials, kubeconfig and service-account tokens, registry publishing tokens, API keys in .env files, and the environment the install ran in. Revoke sessions too, in an order decided in advance. Aqua’s rotation was not atomic, and its analysis says the attacker may have obtained the refreshed tokens.

Does pinning versions in a lockfile protect us?

It stops you drifting onto a bad version by accident, and does nothing at the moment you upgrade. A lockfile records a decision, it does not judge whether it was safe.

It also does not cover your GitHub Actions, which are pinned separately. As the Trivy cascade showed, a tag is mutable and a SHA pin still inherits whatever that commit calls by tag, so pin by commit SHA and check what the commit pulls in.

Resources

Since we recorded

On May 11, 2026 TanStack published a postmortem on 84 malicious versions across 42 @tanstack packages, pushed with an npm OIDC token lifted out of runner memory. No maintainer token was stolen, which says again that trusted publishing protects the credential, not the workflow holding it. StepSecurity ties that self-spreading campaign to TeamPCP, the actor behind Trivy and LiteLLM. The Australian Federal Police has charged two men in Western Australia over an alleged global syndicate that planted malicious code in open source, and episode 108 returns to the update side of this.