The credential stealer planted in Microsoft's agent-framework PyPI package ran during normal Python startup in affected environments, even when nothing imported the package. Two malicious versions, 1.26.1 and 1.26.2, were published on November 17, 2026 under Microsoft's official project, which pulls roughly 200,000 downloads a month. Both kept their dependency on the legitimate agent-framework-core 1.26.0, so the framework behaved normally while the stealer worked in the background.
The trick is the .pth file. Python processes .pth files in site-packages at interpreter startup, and any line beginning with import gets executed. That means a package can run code every time the interpreter starts, with no import of the package itself required. Socket and StepSecurity report that version 1.26.1 shipped agent_framework_meta.pth, which executed the stealer in agent_framework_meta/_telemetry.py at startup. Version 1.26.2 restored the original package initializer and moved the malicious code into af_runtime_diag.pth and af_runtime_diag.py. The mechanism was the same, under different filenames.
Version 1.26.1 harvested secrets from environment variables, local configuration files, and other running processes where permissions allowed, targeting Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, and other services. It also attempted to obtain Azure managed identity access tokens and Azure DevOps OIDC tokens, which could hand the attacker access to additional cloud resources. Version 1.26.2 added GitHub Actions OIDC token requests and searches of GitHub runner directories. Both versions sent what they collected to the same attacker-controlled endpoint, https://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb.
The timeline around PyPI's response is the part worth sitting with. PyPI quarantined the first malicious release. About 2.5 minutes later the attacker published a second version, which was quarantined roughly eight minutes after that. Publishing a second release after the first was quarantined means the attacker still held publishing access to Microsoft's official project through the quarantine. Quarantining one release did nothing to cut off the publishing access behind it. It remains unclear how the attacker gained the ability to publish under Microsoft's project, and Microsoft had not responded to BleepingComputer's questions about the point of breach by publication time.
The attack was discovered and documented by multiple firms, including Socket, StepSecurity, and Ox Security.
What this does to your assumptions
Two things about this one break common habits. First, the stealer runs at Python startup, not when you import the package. A developer who pinned the bad version, installed it, and never wrote a line of code against the framework still ran the stealer the next time a normal Python startup happened in that environment. That is also why the advice covers pip and not only Python: running pip can initiate Python startup too. Second, the framework still worked. Nothing broke, no import failed, so there was no functional signal that anything was wrong. Keeping the dependency on the real agent-framework-core let the framework behave normally.
The OIDC targeting is the detail that should worry anyone running these builds in CI. Harvesting a static AWS key off disk is bad but boundable; you rotate the key. GitHub Actions OIDC tokens and Azure DevOps OIDC tokens are short-lived, but they are the thing your pipelines trade for cloud access, and version 1.26.2 requested GitHub Actions OIDC tokens and searched GitHub runner directories. Those runner-directory searches read as code aimed squarely at a CI environment.
What to do if you pulled either version
If you installed 1.26.1 or 1.26.2, treat the environment as compromised. Isolate it, and do not run Python or pip in it until it is secured, because startup is the trigger. Rebuild from a known-clean environment on the safe 1.26.0 release. Rotate every credential that was within reach of the compromised environment, not only the ones you think were used; the stealer harvested from environment variables, config files, and other processes where permissions allowed.
To scope the actual damage rather than assume worst case, pull your egress logs and search for the specific webhook.site path above. Separate blocked requests from completed transfers. A connection your egress controls refused is a different incident from one that finished, and your egress logs are where you can tell them apart.
Top comments (1)
RC, the timeline is the part that should change how people respond to this, not the .pth trick. PyPI quarantined 1.26.1, and about 2.5 minutes later the attacker published 1.26.2 — then it took roughly eight more minutes to quarantine that one. The quarantine treated the release as the compromised unit, but the attacker still held publishing access to Microsoft's official project through it. So the response fixed the artifact, not the access, and the second release is the proof.
That also reframes the blast radius. The stealer runs at Python startup, not on import — so the question isn't who imported agent-framework, it's who ran any Python at all in an environment where 1.26.1 or 1.26.2 was installed, including pip itself. And 1.26.2 adding GitHub runner-directory searches reads like the attacker already knew the answer: the CI runner is where the OIDC tokens live. Two things I'd want to know: first, what would have actually stopped the second publish — a project-level freeze, or revoking the publisher's credentials — and second, when the stealer could read other running processes where permissions allowed, is 'rotate every credential within reach' even a boundable job? The egress-log check you suggest separates blocked requests from completed transfers, but it only shows what left the network — it can't show what the stealer read and never sent.