Two Malicious Microsoft Agent Framework PyPI Releases Targeted Cloud and CI Credentials

· Original article ↗

Summary

Aikido analyzed malicious agent-framework 1.26.1 and 1.26.2 releases that used Python startup hooks to collect Azure and CI credentials and exfiltrate data to webhook[.]site. Both releases were removed; affected secrets should be rotated.

Key points

  • The agent-framework 1.26.1 and 1.26.2 releases appeared on PyPI on Nov. 17, 2026, 33 minutes apart; both were later removed.
  • A .pth file caused malicious code to run whenever Python started in an affected environment, without importing the package.
  • The payload collected matching environment variables, credentials from files, process environments, and Azure managed-identity tokens.
  • Version 1.26.1 targeted Azure DevOps credentials and tokens; 1.26.2 added GitHub Actions OIDC token theft.
  • The payload compressed and encoded collected data before sending it to webhook[.]site.
  • Aikido recommends checking for the affected versions and .pth files, pinning agent-framework to 1.26.0, rebuilding affected environments, and rotating reachable secrets.

Article Details

Attack Vectors
  • Malicious agent-framework versions 1.26.1 and 1.26.2 added .pth startup hooks that execute Python code whenever an interpreter starts, even if the package is not imported.
  • The stealer collected matching environment variables, read credential files and other processes' environments, and requested Azure managed-identity tokens from the local identity endpoint or IMDS at 169.254.169.254.
  • The payload attempted to obtain Azure DevOps OIDC tokens and, in version 1.26.2, GitHub Actions OIDC tokens when the required workflow credentials were available.
  • Collected data was serialized, compressed, base64-encoded, and sent in a POST request to a webhook.site endpoint.
Defensive Notes
  • Pin agent-framework to version 1.26.0 and rebuild environments that installed 1.26.1 or 1.26.2.
  • Treat secrets accessible to affected machines as stolen and rotate them, including CI tokens, service credentials, registry credentials, and secrets in environment files.
  • Check site-packages directories, CI caches, and container images for agent_framework_meta.pth, af_runtime_diag.pth, and af_runtime_diag.py.
  • Search proxy and DNS logs for webhook[.]site and review Entra ID sign-in logs for pipeline and workflow service principals and federated credentials.
  • Removing the package prevents future runs but does not reverse data already exfiltrated.

Indicators of compromise

TypeIndicatorContext
SHA25621f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5eSHA-256 hash of the malicious Python startup hook in version 1.26.1.
SHA256325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93SHA-256 hash of the malicious Python startup hook in version 1.26.2.
SHA25639fa329f2a93f734b0bb8f5adb203ea3331d1ae479832a5015a54cb17aabd663SHA-256 hash of the credential-stealing payload file in version 1.26.1.
SHA2563d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9SHA-256 hash of the malicious agent_framework 1.26.2 wheel.
SHA25654d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1fSHA-256 hash of the credential-stealing payload file in version 1.26.2.
SHA256c275ccbe520ef3c0f02dc6a35389e427f9f1b4e0b12e140cd7bf7179ce143f02SHA-256 hash of the modified package initializer containing the malicious loader in version 1.26.1.
SHA256d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110SHA-256 hash of the malicious agent_framework 1.26.1 wheel.
URLhxxps[:]//webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetrySpecific webhook.site endpoint used by the malicious releases to exfiltrate collected credentials and other data.

MITRE ATT&CK

Vendors

Products

Related Articles