Credential Stealer Found in Two Microsoft Agent Framework PyPI Releases

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
| Type | Indicator | Context |
|---|---|---|
| SHA256 | 21f28e8517a10ffe431f8d68f5875c85eca4001ae6d118322b0a41873998eb5e | SHA-256 of the malicious agent_framework_meta.pth startup hook. |
| SHA256 | 325e7e9f0ec94e41ad1a1b7a3f18a6b8b5bffece2e2b97b8d3369eb967452f93 | SHA-256 of the malicious af_runtime_diag.pth startup hook. |
| SHA256 | 39fa329f2a93f734b0bb8f5adb203ea3331d1ae479832a5015a54cb17aabd663 | SHA-256 of the credential-collecting _telemetry.py payload. |
| SHA256 | 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9 | SHA-256 of the compromised agent_framework 1.26.2 wheel. |
| SHA256 | 54d885b7d7161c9ed96489c66364c4bfbf635929166843bba10d97d46b5a2e1f | SHA-256 of the af_runtime_diag.py payload used in version 1.26.2. |
| SHA256 | c275ccbe520ef3c0f02dc6a35389e427f9f1b4e0b12e140cd7bf7179ce143f02 | SHA-256 of the compromised package initializer file. |
| SHA256 | d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110 | SHA-256 of the compromised agent_framework 1.26.1 wheel. |
| URL | hxxps[:]//webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry | Specific webhook URL identified as the endpoint used to exfiltrate collected data. |
MITRE ATT&CK
T1057 · Process DiscoveryThe payload inspects other processes' environments through /proc/*/environ and filters for credential-related values.T1059.006 · PythonPython payload modules execute the credential collection and exfiltration logic.T1546.018 · Python Startup HooksThe compromised packages use .pth files to run payload code automatically during Python startup.T1552.001 · Credentials In FilesThe payload reads credential and configuration files, including cloud, Git, Docker, pip, npm, and netrc files.T1552.005 · Cloud Instance Metadata APIThe collectors request Azure managed-identity tokens from cloud identity endpoints, including Azure IMDS.T1567.004 · Exfiltration Over WebhookThe payload POSTs compressed, Base64-encoded collected data to a specific webhook.site URL.
