Microsoft agent-framework PyPI wheels hijack Python startup
Compromised PyPI releases 1.26.1 and 1.26.2 of Microsoft's `agent-framework` dropped malicious `.pth` files into `site-packages` to trigger credential theft on every Python interpreter startup. The stealthy exploit harvested cloud secrets, Azure managed identity tokens, and CI/CD credentials without requiring developers to ever import the package.
Packaging-level `.pth` abuse turns Python's startup routines into an insidious persistence vector that evades standard code review and import-level security scanners. AI developers assembling complex multi-agent stacks in CI/CD environments are prime targets for supply chain attacks that execute silently the moment `pip install` completes.
- –Silent startup execution: Malicious `.pth` hooks (`agent_framework_meta.pth` and `af_runtime_diag.pth`) automatically execute code on any Python invocation in the environment, even if the library is never imported.
- –Cloud and CI/CD credential theft: The payload actively queries Azure managed identity endpoints, inspects local Azure DevOps agent credentials, and extracts GitHub Actions OIDC tokens before exfiltrating data to an external webhook.
- –Evasion against diff scanners: Release 1.26.2 kept core library files byte-identical to legitimate releases while isolating malicious logic in a separate runtime diagnostic file to slip past automated checksum checks.
- –Urgent developer remediation: Affected developers must audit `site-packages` for rogue `.pth` files, wipe infected virtual environments, and rotate all cloud credentials and CI tokens immediately.
DISCOVERED
2h ago
2026-11-19
PUBLISHED
4h ago
2026-11-19
RELEVANCE
AUTHOR
SeanJHKwon