Microsoft agent-framework PyPI Releases Carried a Credential Stealer for 41 Minutes

Summary
Two unauthorized agent-framework versions on PyPI ran a credential stealer at Python startup. Wiz says analysis of 50 stored requests found three successful victim-data thefts; the release path may have involved compromised Microsoft ESRP credentials.
Key points
- Versions 1.26.1 and 1.26.2 were uploaded to PyPI without authorization on November 17, repackaged from legitimate version 1.26.0, and later quarantined; neither was available by 21:30 UTC.
- Both releases added a .pth startup hook that ran the stealer whenever Python started in the environment, without requiring the package to be imported.
- The collector targeted environment variables, credential files, and process environment data, and requested Azure DevOps OIDC, Azure managed identity, and—in version 1.26.2—GitHub Actions OIDC tokens. Static analysis establishes the requests, not whether the tokens were obtained.
- Collected data was compressed, Base64-encoded, and sent once to webhook[.]site. Wiz examined 50 stored requests and reported three unique successful thefts; the victims remain unnamed.
- Wiz says the actor appears to have used a compromised client certificate and private key for Microsoft's Engineering System Release Pipeline (ESRP); how access was obtained remains unknown.
- PyPI's advisory says version 1.26.0 is unaffected and remains the latest release. PyPI removed the malicious versions and worked with Microsoft on account review and remediation.
Article Details
- Attack Vectors
- Versions 1.26.1 and 1.26.2 were uploaded to the official PyPI project without authorization, repackaged from the legitimate 1.26.0 wheel. Wiz assesses with moderate confidence that the publishing path used a compromised ESRP client certificate and private key.
- Each malicious release included a .pth startup hook that ran the stealer whenever Python started in the affected environment, without requiring an import of the package.
- The payload collected host and user details, searched environment variables and credential files, and read environment files from running processes.
- The payload requested Azure DevOps OIDC tokens, Azure managed identity tokens, and, in version 1.26.2, GitHub Actions OIDC tokens. Static analysis establishes the requests, not whether they succeeded.
- Collected data was compressed, Base64-encoded, and posted in a single attempt to the specified webhook.site endpoint.
- Defensive Notes
- Isolate an affected environment before starting Python or pip, since later Python starts can run another collector.
- Check exfiltration logs: the article says a 200 response indicates the host's data was accepted, while a 410 or 429 suggests rejection.
- Check for the affected package versions and their startup hooks; searching only for the 1.26.1 filenames may miss the differently named 1.26.2 hook.
- Review cloud, Azure DevOps, and GitHub audit logs and address potentially issued tokens. The article notes that rotating static secrets may not cancel issued tokens and that stolen managed-identity or exchanged tokens may remain valid for up to 24 hours.
- The article reports that PyPI removed both malicious versions and that 1.26.0 was unaffected and remained the latest release at the time of the advisory.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
| SHA256 | 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9 | SHA-256 hash of the malicious agent-framework 1.26.2 wheel. |
| SHA256 | 54d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1f | SHA-256 hash of af_runtime_diag.py, identified as the 1.26.2 stealer payload. |
| SHA256 | d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110 | SHA-256 hash of the malicious agent-framework 1.26.1 wheel. |
| URL | hxxps[:]//webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry | Reported exfiltration endpoint used by the stealer to post collected data; a connection alone does not establish a successful transfer. |
MITRE ATT&CK
T1027.013 · Encrypted/Encoded FileThe payload stored its exfiltration URL in Base64 and decoded it at runtime.T1036.005 · Match Legitimate Resource Name or LocationThe payload's file and function names were made to resemble legitimate SDK telemetry.T1082 · System Information DiscoveryThe collector recorded the hostname, username, working directory, command-line arguments, and a timestamp.T1195.002 · Compromise Software Supply ChainVersions 1.26.1 and 1.26.2 were uploaded without authorization to the official PyPI project as repackaged versions of the legitimate 1.26.0 wheel.T1528 · Steal Application Access TokenThe payload requested Azure DevOps OIDC tokens and, in version 1.26.2, GitHub Actions OIDC tokens; the article says static analysis does not establish whether the requests succeeded.T1546.018 · Python Startup HooksA .pth file in the package directory ran the stealer on Python startup without requiring the package to be imported.T1552.001 · Credentials In FilesThe collector read credential files including Azure CLI token caches, .npmrc, .netrc, and .git-credentials.T1552.005 · Cloud Instance Metadata APIThe payload requested managed identity tokens from the instance metadata endpoint for twelve resources and retained instance metadata.T1567.004 · Exfiltration Over WebhookThe payload compressed and Base64-encoded collected data and posted it to a webhook.site endpoint.
Vendors
Products
Azure DevOpsinclude TOKEN, SECRET, AZURE, GITHUB, and OPENAI. Wiz describes the stealer as focused on Azure and Azure DevOps.GitHub Actionsfound it keeps up to 8,000 characters of instance metadata. Version 1.26.2 added requests for GitHub Actions OIDC tokens. Wiz notes such tokens can be exchanged for Azure access wherever a federated credentialMicrosoft Agent FrameworkA developer who installed Microsoft's agent-framework package from PyPI on the evening of November 17 never had to import it. A one-line startup file ran the credential stealer the next time any Python tool started inPyPIA developer who installed Microsoft's agent-framework package from PyPI on the evening of November 17 never had to import it. A one-line startup file ran the credential stealer the next time any Python tool started in
