Credential Stealer Found in Two Microsoft Agent Framework PyPI Releases

· Original article ↗

Summary

Socket reports that PyPI versions 1.26.1 and 1.26.2 of Microsoft’s agent-framework package added Python startup hooks to collect credentials and cloud/CI identity tokens and send them to a webhook[.]site endpoint.

Key points

  • Versions 1.26.1 and 1.26.2 contained Python .pth startup hooks that launched credential-collection payloads.
  • The payloads gathered matching environment variables, other processes’ environments, and local credential and configuration files.
  • Both versions requested Azure identity tokens; version 1.26.2 also added GitHub Actions OIDC token collection.
  • Collected data was serialized, compressed, Base64-encoded, and sent to a webhook[.]site endpoint.
  • The article says the reported payloads did not download or execute additional code.
  • Avoid installing the affected versions; if installed, remove them and rotate potentially exposed credentials.

Article Details

Attack Vectors
  • Compromised PyPI package versions 1.26.1 and 1.26.2 execute malicious code through Python startup .pth hooks.
  • The payload collects environment secrets, credential and configuration files, other processes' environment data, and cloud identity tokens.
  • Collected data is compressed, Base64-encoded, and POSTed to a specific webhook.site endpoint.
Defensive Notes
  • Avoid installing agent-framework versions 1.26.1 and 1.26.2.
  • If either version was installed, remove it and rotate potentially exposed credentials.

Indicators of compromise

TypeIndicatorContext
SHA25621f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5eSHA-256 of the malicious agent_framework_meta.pth startup hook.
SHA256325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93SHA-256 of the malicious af_runtime_diag.pth startup hook.
SHA25639fa329f2a93f734b0bb8f5adb203ea3331d1ae479832a5015a54cb17aabd663SHA-256 of the credential-collecting _telemetry.py payload.
SHA2563d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9SHA-256 of the compromised agent_framework 1.26.2 wheel.
SHA25654d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1fSHA-256 of the af_runtime_diag.py payload used in version 1.26.2.
SHA256c275ccbe520ef3c0f02dc6a35389e427f9f1b4e0b12e140cd7bf7179ce143f02SHA-256 of the compromised package initializer file.
SHA256d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110SHA-256 of the compromised agent_framework 1.26.1 wheel.
URLhxxps[:]//webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetrySpecific webhook URL identified as the endpoint used to exfiltrate collected data.

MITRE ATT&CK

Vendors

Products

Related Articles