Cases › security breach › LR-2026-0904
Malicious agent-framework 1.26.1 and 1.26.2 uploaded to PyPI (Microsoft Agent Framework)
Developing: a major or severe case captured in the last 72 hours. Later changes are logged on the corrections page.
- Who did it
- Outside attacker
- Who was hit
- Anyone who installed agent-framework 1.26.1 or 1.26.2 in the window, including CI pipelines, developer laptops and Azure VMs with a managed identity attached
- AI product
- Microsoft Agent Framework
- AI company and model
- Microsoft
- How it was found
- Third party
- Reported
- 17 Nov 2026
- Severity
- Major
- The system is Microsoft's agent-framework Python meta-package on PyPI, used to build AI agents. Its malicious releases ran in developer, CI and Azure environments that installed them.
- Two uploaded versions dropped a .pth file that ran a credential stealer on every Python start, even without importing the package. They sent collected secrets to webhook.site, and 1.26.1 appears to have bypassed the project's release process.
- The stealer targeted Azure and Azure DevOps credentials on any host that installed either version. On the attacker's free-tier token, a maximum of 50 requests were captured.
- Endor Labs, an outside security vendor, detected both malicious packages within three minutes of publication.
What was done
Both malicious versions were gone from PyPI by 21:30 UTC. Users were advised to pin 1.26.0 and rotate exposed credentials.
Fix reported: “Block agent-framework 1.26.1 and 1.26.2 in package proxies or allowlists, pin to a hash-verified version, and rotate credentials the process could read or request” · Short-lived, scoped credentials
Risks Supply-chain compromise (21 incidents) · AI system attacked or breached (54 incidents)
No source states: money lost or records, tools it had, company using the AI, sector.
Similar incidents
Evidence
- When it happened 2026-11-17
Sources (3)
- Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines · Wiz · 2026-11-17
- agent-framework compromised: Python startup hooks steal Azure and CI credentials | Endor Labs · Endor Labs · 2026-11-17
- Two malicious agent-framework releases hit PyPI in 33 minutes · Aikido Security · 2026-11-17
Show the full account: 27 items from the primary sources
What happened, in order
- 2026-11-12 18:25 UTC The last legitimate release, 1.26.0, was published on 2026-11-12 at 18:25 UTC as a wheel plus sdist alongside agent-framework-core 1.26.0.
- 2026-11-17 20:35 UTC Malicious agent-framework 1.26.1 was uploaded to PyPI at 20:35 UTC on November 17, 2026.
- 2026-11-17 21:08 UTC A second malicious version, 1.26.2, was uploaded at 21:08 UTC, and by 21:30 UTC both versions were gone from PyPI.
- 2026-11-17 21:08 UTC 1.26.2 came 33 minutes after 1.26.1 and was a repacked version of it that reported to the same webhook.site URL.
Who and what was involved
- The targeted package is Microsoft's agent-framework on PyPI, which gets about 41,000 downloads a week. The most recent safe version is 1.26.0.
- earlier in 2026 Wiz notes that another Microsoft Python package, durabletask, was compromised earlier in the year after its PyPI token was stolen, but it has not linked the two incidents.
What they used to do it
- On install, the malicious package drops a .pth file in site-packages root, which Python runs on every interpreter start. The stealer therefore runs even if agent-framework is never imported.
- In 1.26.1 the .pth file imports agent_framework_meta, whose __init__.py calls _telemetry._start(). The stealer forks into a detached session, or uses a daemon thread where fork is unavailable.
- The stealer collects environment variables whose names contain strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS and GITHUB.
- It also reads secret-looking values from the environments of other processes, up to 300 /proc/*/environ files.
- If Azure DevOps variables SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI are set, the stealer requests an OIDC token for api://AzureADTokenExchange.
- It steals Azure managed-identity tokens from IMDS or the App Service identity endpoint, covering 12 resources including ARM, Graph, Key Vault and Storage.
- All collected data is placed in one JSON document, zlib-compressed, base64-encoded and sent in a single HTTPS POST to webhook.site. The URL is hardcoded with no fallback channel.
- Version 1.26.2 steals GitHub Actions OIDC tokens in workflows with id-token: write. Where an Entra ID federated credential trusts the workflow, the tokens can be exchanged for Azure access without a stored secret.
- 1.26.2 widened collection by adding ACTIONS, OIDC, RUNNER and ARM_ env matching and GitHub runner paths. It also raised the file cap from 60 to 80.
- 1.26.2 changed its trigger: __init__.py was restored to the clean 1.26.0 file, and a new top-level af_runtime_diag.pth imports af_runtime_diag.py, which starts the stealer.
What they did to avoid being caught
- The file and function names and user-agent were chosen to look like legitimate SDK telemetry.
- The stealer detaches into its own session and sets _AF_TEL=1 so child processes do not run it again.
- Exfiltration failures are silently ignored and not retried.
- Because 1.26.2 uses different file names, searching only for the 1.26.1 file names would miss it.
What made it possible
- Version 1.26.1 appears to have been built outside the normal release process. It was a wheel only, with no sdist and no agent-framework-core of the same version, and it still depends on agent-framework-core[all]==1.26.0.
- No python-1.26.1 tag or release exists in microsoft/agent-framework, and the main branch does not contain the malicious code.
How it was found
- Egress checks can look for the exfiltration URL in proxy and DNS logs. A 200 means the host's data was accepted, and a 410 or 429 suggests it was rejected.
What it reached, and the numbers
- The attacker's webhook.site token was on the free tier, and at most 50 requests were captured. Those requests can still contain working cloud, CI and registry credentials.
- Stolen managed-identity and OIDC-exchanged tokens remain valid for up to 24 hours.
What the sources say is still unknown or disputed
- The root cause has not been confirmed. Wiz says 1.26.1 may have been uploaded directly to PyPI.
- Wiz has not established whether the durabletask compromise is related to this incident.
Show every field, with its source and grade
The AI system
What happened
Impact
Context
Notes on gaps
Initial access (how the attacker obtained publishing ability) is unknown.
LR-2026-0904 · version 3 · published 2026-11-18 after automatic checks; not yet checked field by field by a person