As reported by The Hacker News, threat actors compromised Microsoft's agent-framework PyPI package on November 17, 2026, publishing malicious versions 1.26.1 and 1.26.2 just 33 minutes apart. This is not a routine supply chain incident — it is a precision strike against the AI development ecosystem that exploits a fundamental weakness in Python's package execution model.
Why This Attack Is Different
Most malicious PyPI packages rely on typosquatting or social engineering to trick developers into installation. This attack compromised a legitimate, Microsoft-maintained package — meaning developers had every reason to trust it. The threat actor gained publishing access through means that remain unclear, which raises urgent questions about maintainer account security at major vendors.
The technical mechanism is particularly insidious. Rather than embedding malicious code within the package's importable modules, the attacker dropped .pth files into the site-packages directory. Python executes import statements within .pth files on every interpreter start, meaning the credential stealer activates whenever Python launches — including when running pip itself — regardless of whether the package is ever imported in code.
This means a developer who installed the package in a CI/CD runner, a Docker build, or even a local virtual environment triggered credential exfiltration on every subsequent Python invocation across that entire environment.
The Credential Harvesting Scope
The payload is comprehensive and cloud-aware. It does not merely scrape static credential files. According to analysis from SafeDep, Socket, and Wiz, the stealer actively requests new tokens from platform identity endpoints — a critical distinction that means secret rotation alone is insufficient remediation.
Targeted Credential Sources
~/.azure/*.json).npmrc, .netrc, .git-credentials, .docker/config.json, pip.confWho Is at Risk
The exposure profile is broad but concentrates in specific deployment patterns:
- AI/ML engineering teams building agents with Microsoft's framework — the primary user base
- CI/CD pipelines that installed the package during build steps, especially Azure DevOps pipelines where SYSTEM_ACCESSTOKEN and OIDC endpoints are available
- Azure-hosted workloads (App Service, Functions, VMs) where managed identity endpoints are reachable
- Containerized environments where the package was installed in a base image, potentially persisting across downstream images
- Shared development environments where a single installation compromises every developer using that interpreter
The 33-minute window between version publications suggests the attacker was iterating — possibly adjusting the payload or fixing delivery issues. This indicates a live, hands-on-keyboard operator rather than an automated campaign, raising the likelihood of targeted post-exploitation using stolen tokens.
Broader Implications
This attack underscores a systemic problem: the Python ecosystem's .pth execution mechanism is a well-known footgun that package maintainers cannot easily defend against once a malicious wheel is installed. The fact that a Microsoft-owned package was compromised also demonstrates that vendor reputation provides no supply chain guarantee — the trust model is only as strong as the maintainer account's authentication controls.
The targeting of Azure DevOps OIDC tokens is especially significant. Federated identity tokens are short-lived but can be exchanged for access tokens to arbitrary resource APIs if the attacker moves quickly enough. This converts a supply chain compromise into potential lateral movement across an organization's Azure tenant.
Shield53 Recommendations
Immediate Actions
- Audit package installations: Check all Python environments — local, CI/CD, and containerized — for versions 1.26.1 or 1.26.2 of
agent-framework. Remove immediately. - Scan for .pth persistence: Search site-packages directories for
agent_framework_meta.pthoraf_runtime_diag.pth. These files persist even after package uninstall in some cases — remove manually. - Rotate all exposed credentials: This includes Azure CLI tokens, .netrc entries, npm tokens, Docker Hub credentials, Hugging Face tokens, git credentials, and any environment variables that may have been captured.
- Invalidate Azure DevOps pipeline tokens: Review Azure DevOps audit logs for any token exchange activity or unusual API calls originating from the compromised pipeline runners.
- Review Azure managed identity activity: Check Azure Activity Logs for token issuance from IMDS endpoints on any compute resources where the malicious package may have been installed.
- Pin package versions: Until the compromise root cause is published, pin
agent-frameworkto a known-good version (pre-1.26.1) in requirements files and lockfiles.
Longer-Term Hardening
- Implement PyPI dependency scanning with tools like Socket, pip-audit, or safety in CI pipelines with blocking policies on known-malicious packages
- Adopt ephemeral CI runners that are destroyed after each job to limit credential exposure windows
- Enforce managed identity least privilege — ensure no identity has broader resource API access than required
- Deploy egress filtering on build environments to block outbound connections to webhook.site and similar exfiltration infrastructure
- Monitor for
.pthfile creation in site-packages directories as a detection signal for this class of attack
Supply chain attacks against AI tooling are accelerating. This incident demonstrates that the intersection of open-source package ecosystems, cloud identity, and AI development frameworks creates a uniquely exploitable attack surface. Defenders must treat every package installation as a potential credential exposure event — because in this case, it literally was.