On November 17, two releases of Microsoft’s agent-framework package on PyPI ran a credential stealer every time Python started, according to SafeDep’s analysis. I think teams that installed either one should treat the incident as a token problem as much as a secret problem, and should shrink what their build identities can reach before the next poisoned package arrives.
What the analysis shows
SafeDep reports that version 1.26.1 reached PyPI at 20:35 UTC and 1.26.2 followed at 21:08, after PyPI had removed the first. Each wheel adds a startup file that runs the stealer on every interpreter launch, so a pip install in a CI job was enough. Nothing had to import the package.
The stealer takes environment variables and credential files. SafeDep says it also asks the platform for new tokens: Azure DevOps and managed identity tokens in the first release, and GitHub Actions OIDC tokens in the second. In SafeDep’s words, “Rotation does not undo the tokens it had issued.” A token minted at install time stays valid until it expires, whatever happens to the secret that was used to request it.
SafeDep flagged the first release 22 minutes after it appeared and the second 4 minutes after upload. It also says the project gets about 192,000 downloads a month and that how many installs the bad versions received is not yet known. PyPI lists a maintainer account called vibiret, created on the day of the attack, with publish rights to the package and five sibling projects. SafeDep says neither PyPI nor Microsoft has confirmed that account as the uploader.
My argument
The usual response to a stolen-secret incident is to rotate everything the machine could read. That is necessary and it is not sufficient. Here the code could ask Azure or GitHub for fresh credentials on its own, so the blast radius depends on what the build’s identity is allowed to do, and that is a design decision made long before the incident. I would make three changes.
- Give each pipeline an identity that can reach only what that pipeline deploys. A federated token that can touch Key Vault, Storage and Resource Manager for the whole subscription turns a package compromise into a cloud compromise.
- Lock the whole dependency tree with hashes. SafeDep notes that a pin on agent-framework alone leaves four sibling packages free to update, and that
pip-compile --generate-hashesoruv lockrecords the versions you have today. - After an exposure, review sign-in and activity logs for the managed identities and federated credentials the environment could use, from the install time onward. SafeDep recommends this for the same reason: the tokens left the building.
The strongest objection
The best case against this is that identity scoping is slow and unglamorous, and a team facing a release deadline will not split one deployment identity into six. A second objection is that hash locking does not help a team that bumps a version on purpose, and both bad releases were published under the real package name by whoever held the publishing path. A lockfile records what you chose. It does not tell you whether the choice was safe.
Both points hold. They are why I would pair the lockfile with a delay. SafeDep flagged the first bad release within 22 minutes and the second within 4, and PyPI removed both. A cooldown that keeps new releases out of builds for a day would have kept both versions out of any pipeline that applied it. We argued that a cooldown longer than the default belongs in policy, and this incident gives the argument a concrete case. For the scoping objection, I would start with the pipelines that hold production cloud access and leave the rest for later. Those few identities carry most of the risk.
What I would do this week
Search lockfiles and requirement files for agent-framework 1.26.1 and 1.26.2, and check runners and images for the startup files SafeDep lists. If either version was installed anywhere, treat every secret reachable from that environment as exposed, and read the cloud activity logs for the identities it could use. Then list every pipeline identity with subscription-wide or organization-wide rights and pick the three with the most reach. We covered the wider pattern earlier this month in the wfx-loot campaign against CI secrets, where CI secrets were the target.
Source: SafeDep, Microsoft agent-framework Compromised Twice on PyPI