Blog

Open Source Malware Runs at Install Time. Watch the Install.

Pablo Bleck

December 4, 2026

A new open source package reaches a developer's laptop or a CI runner with three checks already behind it. It came from a public registry, its name and version matched what someone asked for, and no vulnerability database flagged it. Then pip or npm installs it, and its install scripts, build hooks, and startup files run with the same access as the developer or the build agent.

Attackers want that access. In March 2026, a compromised LiteLLM release on PyPI shipped a .pth file that ran a credential stealer as soon as the package was installed, before anyone imported it.[1] The checks most teams rely on tell you whether a package is known to be bad. The attacks that hurt most in the last two years were new when they landed, and they did their work during the install.

Key takeaways

  • The most damaging recent open source attacks ran their payloads while packages installed or built, before anyone imported the code.
  • Vulnerability and malware databases tell you what a package is known to be. Watching it run tells you what it does with the access it gets.
  • AI coding assistants pull in open source dependencies faster than people review them, so more packages reach install without a human look.
  • ActiveState is building behavioral analysis that runs each package in an isolated VM and records what it does, as one layer among several.
  • A run that produces too little evidence counts as inconclusive, never clean.

The damaging attacks ran their payloads during install

The xz backdoor came to light in March 2024 because a developer noticed SSH logins on his Linux machine taking longer than they should.[2] The malicious code had already made it into release tarballs and was on its way into Linux distributions. A change in behavior gave it away.

The Shai-Hulud worm spread through npm in 2025 with a post-install script. Once it ran, it searched the machine for credentials such as npm and GitHub tokens, then used a stolen npm token to publish infected versions of the developer's other packages.[3] LiteLLM was hit a second time in October 2026, through its release pipeline, with a version that loaded a credential stealer every time Python started.[4]

Each of these arrived from the expected registry under the expected name. What set them apart from the clean packages installed alongside them was what they did: reading credentials they had no reason to touch, calling hosts nobody recognized, and adding startup hooks a library doesn't need.

More open source arrives with less review

Volume makes this harder. ReversingLabs counted a 73% increase in malicious open source packages in 2025.[5] At the same time, AI coding assistants add dependencies faster than people review them. One accepted suggestion can bring a whole dependency tree, and generated code often skips the review that used to catch an odd package name.

Our own research shows the same pressure. In The AI Remediation Bill, 94% of respondents said AI has increased their open source consumption, and 63% said they address open source vulnerabilities only after a scanner finds them.[6] Scanners are the backstop, and they should stay. They tell you whether a package matches something already known. A payload published an hour ago matches nothing yet.

Watching a package run shows what it does with your access

I explain it to engineers like this. Checking a component against known vulnerabilities is the blood test: fast, and good at finding what you already know to look for. Watching what the component does while it installs and runs is the MRI. You need both.

During an install, a well-behaved library has little reason to do any of these:

  • read credentials, secrets, or environment variables
  • connect to a command-and-control (C2) server or a host it has no business reaching
  • check the date before deciding whether to act
  • start child processes or write files outside its own directory

Each one shows up in a record of system calls, whether or not anyone has seen the payload before.

How we're building behavioral analysis at ActiveState

At ActiveState we're building behavioral analysis for the open source components we build from source. Each package runs in a fresh, isolated micro-VM with no real internet access. While it builds, installs, imports, and runs its tests, an eBPF sensor records what it does on the system. We also watch the network services it tries to use, and every attempt is blocked and recorded. Written rules turn that evidence into a verdict, and the same evidence always produces the same verdict.

We don't stop at the install. We find every function in a package's source and call as many as each run allows, so we exercise far more of the code than a plain install does. We use AI to build those tests. The more of a package we exercise, the more evidence the verdict rests on. The verdict itself still comes from written rules.

We read every result with two cautions. First, a run that produces too little evidence counts as inconclusive, never clean. Second, no sandbox reaches every code path. Code generated at runtime and parts of compiled libraries can stay hidden, and some malware waits for a date or looks for signs of a sandbox before it acts. Just as I was finishing this piece, researchers at Island reported a PyPI campaign that does exactly that. DevGating splits its malicious code across two packages and stays quiet until the requests library is loaded, so checking either package on its own turns up nothing.7

One layer, aimed at attacks that hide

Those limits are why behavioral analysis sits alongside other checks: registry removal signals, known-malware feeds, a static scan when a package first comes in, and a final scan of what we built. Most malicious packages act the moment they install, so the earlier layers catch most of them. The behavioral check earns its place on attacks built to hide and wait, the way xz did. When it catches something late, the finding becomes a YARA rule that catches the next one earlier.

Today it's a working prototype. It runs on Python packages on Linux, triggered by hand, and we're using it on our own catalog first. npm is next.

What we want to learn from security and platform teams

We're choosing a small group of security and platform leaders as design partners for 2027. The open questions are practical: which ecosystem matters most after Python, what evidence your team would act on, and whether the check belongs in our pipeline or yours.

I'll be running the demo live at Black Hat Europe 2026 in London on December 9 and 10, at ActiveState's booth (627). Pick a package from our catalog and watch what it does as it installs and runs.

Start with the last package your team installed

You can see where your team stands without new tooling. Take one open source package that entered a build last week and ask what it did during install: what it read, which hosts it contacted, and what it started. If nobody can answer, your team is deciding what gets in on a package's name and history alone. What it does at install is the evidence to add next.

Sources

[1] Simon Willison, "Malicious litellm_init.pth in litellm 1.82.8," Simon Willison's Weblog, March 24, 2026. https://simonwillison.net/2026/Mar/24/malicious-litellm/

[2] InfoQ, "SSH Backdoor from Compromised XZ Utils Library," April 2024. https://www.infoq.com/news/2024/04/xz-backdoor/

[3] Unit 42, Palo Alto Networks, "'Shai-Hulud' Worm Compromises npm Ecosystem in Supply Chain Attack," November 25, 2025 (updated November 26, 2025). https://unit42.paloaltonetworks.com/npm-supply-chain-attack/

[4] Wiz, "LiteLLM Compromised, Steals Credentials," October 2026. https://www.wiz.io/blog/litellm-compromised-steals-credentials

[5] ReversingLabs, 2026 Software Supply Chain Security Report, press release, January 27, 2026. https://www.reversinglabs.com/press-releases/reversinglabs-2026-software-supply-chain-security-report-identifies-73-increase-in-malicious-open-source-packages

[6] ActiveState, The AI Remediation Bill, research by Moving Horizon, September 2026 (307 survey respondents and 10 interviews, July and August 2026; self-reported). https://go.activestate.com/ai-remediation-bill

[7] The Hacker News, "8 Malicious PyPI Packages Use Python Dependencies as Keys to Unlock Hidden Malware," December 3, 2026, https://thehackernews.com/2026/12/8-malicious-pypi-packages-use-python.html

Frequently Asked Questions

What is install-time malware?

Malicious code that runs while an open source package installs or builds, through install scripts, build hooks, or startup files, before anyone imports it. It runs with the access of the developer or build agent, so it usually goes after tokens and cloud credentials.

How is behavioral analysis different from a vulnerability scanner?

A scanner checks whether a component matches a known vulnerability or known malware. Behavioral analysis runs the component in isolation and records what it does, so it can flag a payload nobody has catalogued yet. Teams need both, with the scanner as the backstop.

Can malware detect a sandbox and stay quiet?

Some do, by checking the date, waiting, or looking for signs of a test environment. A behavioral check looks for those checks and marks a run with too little evidence as inconclusive. That's why it works best as one layer alongside malware feeds and static scans.

Does AI-assisted coding raise exposure to malicious packages?

It raises the volume. One accepted suggestion can pull in a whole dependency tree, and 94% of respondents in The AI Remediation Bill said AI has increased their open source consumption. More packages reach install before a person looks at them.