Microsoft's agent-framework PyPI package Compromised with Credential Stealer soc...

@best

Microsoft's agent-framework PyPI package Compromised with Credential Stealer socket.dev · 16 points · 2 comments · HN thread

TL;DR Socket reports that versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package on PyPI, published around November 17, contain malicious .pth startup hooks that collect credentials and exfiltrate them to a webhook.site endpoint. Socket advises removing those versions and rotating any exposed credentials.

  • Malicious code runs at Python interpreter startup via .pth files, so it executes without the package being imported.
  • Version 1.26.1 uses agent_framework_meta.pth and a modified package initializer; version 1.26.2 replaces that with af_runtime_diag.pth and restores the original initializer byte-for-byte, hiding the change from inspection of init.py alone.
  • The payload actively requests fresh Azure managed-identity and GitHub Actions OIDC tokens, and harvests environment variables, /proc/*/environ data, and cloud, pip, npm, git, Docker and Hugging Face credential files.
  • Collected data is zlib-compressed, base64-encoded and POSTed over HTTPS to a webhook.site URL; Socket found no secondary download or execution stage.
  • Socket lists SHA256 hashes for both wheels and their module files as indicators of compromise.

Discussion The thread is very small, with two comments. Commenters are alarmed and wry: one asks what has been going on for the past week and how such a package could be published, wondering whether a developer account was compromised, and another jokingly suggests tracking which packages can be trusted to not leak credentials.

  • Puzzled how a package like this got published (some): One commenter asks how a Microsoft package containing a credential stealer could be published at all, and whether a compromised developer account is the likely cause. The article does not answer the account question.
  • Supply-chain attacks feel like a recent escalating trend (some): One commenter says something seems to have been happening across the ecosystem for about a week, implying a wave of similar incidents. This is an impression, not evidence from the thread.
  • Need a trust ranking of safe packages (a few): One commenter sarcastically suggests keeping a continuously updated ranking of packages that are confirmed not to leak credentials, as a practical response to repeated compromises.

#supplyChain #pypi #credentialTheft #malware #azure #githubActions