Microsoft’s Agent Framework PyPI Package Compromised to Harvest Cloud Credentials
What Happened — On 17 November 2026, threat actors gained publishing rights to Microsoft’s official Agent Framework package on the Python Package Index (PyPI) and released two malicious versions, 1.26.1 and 1.26.2. Both packages retained a dependency on the legitimate agent-framework-core 1.26.0, allowing normal functionality while a hidden payload executed automatically during Python interpreter start‑up—even when the agent-framework module was never imported.
Version 1.26.1 contained a credential‑stealer that scraped environment variables, local configuration files, and in‑memory process data for secrets tied to Azure, AWS, GitHub, Docker, Hugging Face, OpenAI and other cloud services. It also attempted to retrieve Azure managed‑identity tokens and Azure DevOps OIDC tokens, potentially granting the attackers broader access to the victim’s cloud resources.
Version 1.26.2 added logic to request GitHub Actions OIDC tokens and to enumerate files in GitHub runner directories, expanding the attack surface to CI/CD pipelines. In both releases the malicious code was injected via a .pth file (agent_framework_meta.pth in 1.26.1, af_runtime_diag.pth in 1.26.2) that Python loads automatically at start‑up. The stolen data were exfiltrated to a single attacker‑controlled webhook endpoint (https://webhook.site/d381fd80‑ec62‑42ad‑8f5c‑d1b15103c9bb).
Security firms Socket, Step Security and Ox Security independently discovered the tampered releases, reported them to PyPI, and documented the technique. PyPI quarantined the first malicious version within minutes, but the attackers republished a second version only 2.5 minutes later. The second release was also removed roughly eight minutes after its appearance, indicating the adversary retained publishing access after the initial takedown.
How the attackers initially compromised the Microsoft‑owned PyPI project remains unknown. No public statement from Microsoft had been obtained at the time of reporting. The incident highlights a classic supply‑chain compromise: a trusted open‑source component was subverted to deliver a credential‑stealer directly to developers’ development environments.
Why It Matters for Trust & Control Assurance — The breach underscores the need for continuous monitoring of third‑party code and strict package‑integrity controls, a core element of vendor risk management.
Who Is Affected — Software developers, DevOps teams, and any organization that integrates the Microsoft Agent Framework library into Python applications—spanning cloud‑native SaaS providers, fintech, AI research labs, and internal engineering groups.
Recommended Actions
- Immediately stop using the compromised versions (1.26.1, 1.26.2). Re‑install the clean 1.26.0 release from a trusted source.
- Rotate any cloud credentials, tokens, or API keys that may have been present on affected machines.
- Scan egress logs for outbound requests to the malicious webhook URL and block any successful transfers.
- Implement automated SBOM (Software Bill of Materials) generation and continuous monitoring of PyPI packages for unauthorized updates.
- Review and tighten publishing permissions for all internal and external package repositories.
Technical Notes
- Attack vector: Compromised third‑party dependency (PyPI package).
- Malware delivery: Python start‑up hook via
.pthfiles; executed without explicit import. - Data exfiltrated: Cloud service credentials (Azure, AWS, GitHub, Docker, Hugging Face, OpenAI), OIDC tokens, managed‑identity tokens.
- Indicators of compromise: Presence of
agent_framework_meta/_telemetry.pyoraf_runtime_diag.pyin site‑packages, outbound HTTPS towebhook.site/d381fd80‑ec62‑42ad‑8f5c‑d1b15103c9bb. - Remediation status: PyPI has removed the malicious releases; Microsoft has not publicly disclosed the root cause.