Malicious Microsoft agent-framework PyPI Releases Contain Credential-Stealing Hooks

· Original article ↗

Summary

Static analysis found credential-stealing payloads in Microsoft agent-framework 1.26.1 and 1.26.2 on PyPI. Their .pth hooks harvest credentials and attempt identity-token requests; successful transfer is unconfirmed. PyPI quarantined both releases.

Key points

  • Static analysis of the quarantined wheels found that both releases contain .pth startup hooks that execute during Python site initialization without importing Agent Framework.
  • The payload harvests matching environment variables, credential files, and readable process environments; it also attempts to request GitHub Actions, Azure DevOps, and managed-identity tokens.
  • Collected data is compressed and sent in a POST request to hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb; the analysis does not establish that data was successfully transferred or tokens successfully issued.
  • The attacker uploaded 1.26.2 shortly after PyPI quarantined 1.26.1, demonstrating publishing access persisted through the second upload; the uploader’s identity and initial access method are unknown.
  • PyPI quarantined versions 1.26.1 and 1.26.2; the article identifies 1.26.0 as the last clean release.
  • Recommended response includes isolating affected environments before running Python or pip, rebuilding from a clean base, treating readable or requestable credentials as potentially exposed, and reviewing egress and identity-access logs.

Article Details

Attack Vectors
  • The official PyPI package agent-framework versions 1.26.1 and 1.26.2 were published with malicious payloads; the article says the initial access vector and uploader identity are not established.
  • The wheels installed .pth startup hooks that execute Python payload code when the interpreter processes the affected site-packages directory, without requiring an import of agent-framework.
  • The payload harvested environment variables, credential files, and readable process environments, and attempted to obtain GitHub Actions OIDC, Azure DevOps OIDC, and Azure managed identity tokens. The article does not establish that token issuance or cloud access succeeded.
  • The payload compressed and base64-encoded collected data and attempted to POST it to a UUID-specific webhook.site URL. A connection alone does not establish successful exfiltration.
Defensive Notes
  • Isolate affected environments before starting Python or pip; rebuild from a clean base and pin to agent-framework 1.26.0, identified in the article as the last clean release.
  • Treat credentials the payload could read or request as potentially exposed; rotate them from a clean system and review GitHub OIDC permissions, Azure federated credentials, Azure DevOps service connections, and managed-identity access.
  • Investigate egress logs for the UUID-specific webhook.site path and the reported payload user-agent strings. Distinguish blocked attempts from completed transfers; the shared webhook.site domain alone is not incident-specific.
  • Check affected environments for the reported .pth and payload files. Removing a hook alone does not terminate a collector process that may already be running.
  • Review package records, dependency caches, internal mirrors, and images for versions 1.26.1 and 1.26.2; registry quarantine does not remove copies already downloaded.

Indicators of compromise

TypeIndicatorContext
SHA25621f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5eSHA-256 hash of the malicious agent_framework_meta.pth startup hook from version 1.26.1.
SHA256325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93SHA-256 hash of the malicious af_runtime_diag.pth startup hook from version 1.26.2.
SHA25639fa329f2a93f734b0bb8f5adb203ea3331d1ae479832a5015a54cb17aabd663SHA-256 hash of the malicious agent_framework_meta/_telemetry.py payload file from version 1.26.1.
SHA2563d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9SHA-256 hash of the quarantined malicious agent-framework 1.26.2 wheel.
SHA25654d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1fSHA-256 hash of the malicious af_runtime_diag.py payload file from version 1.26.2.
SHA256d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110SHA-256 hash of the quarantined malicious agent-framework 1.26.1 wheel.
URLhxxps[:]//webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetryUUID-specific endpoint to which the payload attempts to POST collected data; a connection does not confirm successful exfiltration.

MITRE ATT&CK

Vendors

Products

Related Articles