Skip to Content

Poisoned PyPI package: would a one-day wait have stopped it?

Two fake releases of Microsoft's agent-framework lived for less than an hour on PyPI. A dependency cooldown would have filtered them out, but the counter-arguments are strong too
November 20, 2026 · Devertix

On 17 November 2026 at 20:35 (UTC), release 1.26.1 of Microsoft's Python package agent-framework appeared on PyPI with credential-stealing code, followed 33 minutes later by release 1.26.2. According to Wiz's analysis, neither was available by 21:30. That period of less than an hour was enough for builds installing without an exact version to run the attacker's code.

33 minutespassed between the uploads of the two poisoned releases

What did the code do?

agent-framework is Microsoft's framework for building AI agents, which according to Endor Labs is downloaded roughly 190,000 times a month. The poisoned releases placed a .pth file in the site-packages directory. Python runs this at every start-up, even if nobody imports the package in the program. So it was enough for the package to end up in a container image or in the environment of a CI run.

According to the descriptions by Wiz and Endor Labs, the code collected the environment variables whose names contain, for example, TOKEN, SECRET, KEY, AZURE, AWS or GITHUB, went through the environments of up to 300 other processes, and in version 1.26.2 read out up to 80 credential files (Azure CLI, Docker, npm, pip, Git). In Azure it requested fresh managed identity tokens. In an Azure DevOps run, and in release 1.26.2 in a GitHub Actions run as well, it requested an OIDC token if the job allowed this. It sent the result to the webhook.site service in a single HTTPS request.

How the attacker obtained upload rights has not been publicly disclosed by Microsoft, according to CSO Online's article of 18 November. Wiz's view is that the attacker obtained a client certificate and key for Microsoft's release system (ESRP); how is not known. A tell-tale sign was that the source distribution (sdist) was missing from both poisoned releases, although according to Endor Labs it was present in every release between 1.21.0 and 1.26.0.

By all appearances, the exfiltration affected few victims. Wiz analysed the 50 requests stored by the collection endpoint and found three unique, successful data exfiltrations among them. In our own reading, the attacker's choice of channel also played a part in this, because according to Wiz the free tier of webhook.site accepts 100 requests. A more careful attacker does not leave this to chance.

A one-day wait

According to Endor Labs, even a 24-hour minimum release age on the package proxy would have kept both releases away from the builds that follow the rule. This is what is called a dependency cooldown. The tools already support it: pip 26.1 handles it, according to InfoQ's summary, with the --uploaded-prior-to option (for example P7D, i.e. seven days), and uv with the exclude-newer setting. After the litellm and telnyx case of spring 2026, the PyPI team itself recommended this, paired with vulnerability scanning. In that case, the poisoned releases of litellm could be downloaded for 2 hours 32 minutes from upload to quarantine, and those of telnyx for 3 hours 42 minutes, and litellm was downloaded more than 119,000 times during that time.

The objection is serious too. Sonatype, which itself sells package-filtering products, calls the cooldown a bet: it counts on someone else spotting the malware in the meantime, while the patient attacker simply waits out the period. Richard Si, one of pip's developers, quoted by InfoQ, warns that the cooldown also holds back genuine security fixes. According to PyPI's description, this is why Dependabot and Renovate exempt security updates from the cooldown by default.

Our view: in the build environment, a cooldown of a few days is cheap insurance, because in the cases mentioned the poisoned releases disappeared within hours. On its own, though, it is not enough. The hash-locked dependency list decides what can get in at all, and the build machine's permissions decide what gets taken if something does get in after all.

SafeguardWould it have stopped it?WhyLimitation
Hash-locked dependency listYesThe pinned 1.26.0 stays. According to Endor Labs, it was the installations without an exact version that received the poisoned release.A run that updates the lock can also write in the poisoned version.
24-hour cooldown on the package proxyYesAccording to Endor Labs, it would have excluded both releases.It does not stop the patient attacker, but it does delay the urgent fix.
Egress allowlist on the build machinePartlyThe request to webhook.site would have been blocked; OX Security recommends blocking this address from build machines.By then the code has already run, and it can also get out via a permitted address.
id-token: write only where it is neededPartlyIn a GitHub Actions run, 1.26.2 could only request an OIDC token if it held this permission.It does not protect the environment variables or the files.
Blocklist on the package proxyToo lateIt protects the subsequent builds.Whatever ran before then has already sent the data.
The descriptions in the rows are based on the analyses by Wiz, Endor Labs and OX Security; the classification and the limitations are based on our own assessment.

Four questions about your own pipeline

  • Where do your builds install from? Which ones reach PyPI directly, and which go through your own package proxy, where the cooldown and the blocklist can be set in one place?
  • Is there locking? Is a hash-locked list produced in every Python project (uv lock, pip-compile --generate-hashes), and does CI use it? According to the PyPI blog, the output of pip freeze is not a lock file.
  • What can be reached from the build machine? Which secrets sit in environment variables, which job has the id-token: write permission, and what can the machine's managed identity reach?
  • How long does rotation take? If such a package ran on one of your build machines tomorrow, how many hours would it take to replace every secret the machine could have reached?

How the attacker got access to Microsoft's release system is an open question, and it may come to light in the coming weeks. On your own side there is no need to wait for it: the second question can be answered in an afternoon, and the answer shows which projects are installing without locking today.

The cooldown, locking and the build machines' permissions are best put in order together, because none of them makes up for another. This is part of introducing DevSecOps and of designing the CI/CD pipeline. If rotating secrets and monitoring outbound traffic is an ongoing task, managed security monitoring can take it over.

Sources

Software supply chain

What gets into your builds from PyPI?

We review your package sources, your locking and the secrets on your build machines, and make a recommendation on the cooldown period.

Free consultation

New articles and webinar dates by email

We will let you know when a new article is published or a new webinar is announced. You can unsubscribe at any time.

Thank you, you have subscribed to the newsletter.

By subscribing, I confirm that I have read the privacy notice.