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

· Original article ↗

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

TypeIndicatorContext
SHA2563d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9SHA-256 hash of the malicious agent-framework 1.26.2 wheel.
SHA25654d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1fSHA-256 hash of af_runtime_diag.py, identified as the 1.26.2 stealer payload.
SHA256d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110SHA-256 hash of the malicious agent-framework 1.26.1 wheel.
URLhxxps[:]//webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetryReported exfiltration endpoint used by the stealer to post collected data; a connection alone does not establish a successful transfer.

MITRE ATT&CK

Vendors

Products

Tools

Industries

Related Articles