Back Home

AI 安全

Microsoft Agent Framework Packages Infected With Credential Stealer; Credentials Still Need Rotation After Downgrade

Two withdrawn versions of agent-framework were affected. Simply starting Python could trigger the malware, making the review of developer machines and CI hosts extend beyond model API keys.

Wikideas1 · CC0 · Image source
zh-Hant

Teams that installed agent-framework 1.26.1 or 1.26.2 on developer machines or continuous integration (CI) hosts need to address potentially exposed credentials. The GitHub Advisory Database records that these two versions of the Microsoft Agent Framework package contained credential-stealing malware and have been removed from PyPI; the advisory lists 1.26.0 as the last clean version. Security advisory

In its original analysis, Elastic Security Labs recommends treating secrets readable by affected hosts as exposed. This is an incident-response principle, not confirmation that every credential was successfully exfiltrated. But downgrading cannot recover keys that may already have been stolen. Elastic analysis

The malware could trigger without importing the agent package

According to the malicious-package record indexed by OpenSSF, the two versions were published on November 17, 2026. The tampering was in an integration package that pulled in framework dependencies; its core dependency was still pinned to agent-framework-core[all]==1.26.0. As a result, checking only the core package version could miss the implant in the integration package. OpenSSF record

The entry point was a .pth file placed in Python’s package installation directory, site-packages. These files can extend the module search path, and lines beginning with import can also execute code. When Python reads that directory during its normal startup process, it may load the malware without the application explicitly importing the agent package. Using -S to disable site initialization is a different case. Official Python documentation

Risk extends to package registries and deployment permissions

The advisory lists collection targets including environment variables with names containing TOKEN, SECRET, KEY, or OPENAI, as well as Azure, npm, Git, Docker, and Hugging Face credentials and .env files. The malware also attempts to read environment variables from other processes. Version 1.26.2 added logic to collect GitHub Actions OIDC tokens. Security advisory

OIDC lets a workflow exchange proof of identity for service access, so the risk may extend to cloud deployments. Elastic found that the malware also requested Azure managed identity tokens, but noted a limitation in the Azure DevOps flow: the request lacks a serviceConnectionId, so it is unclear whether it could obtain a usable token under a federated identity configuration. These findings describe the malware’s capabilities and attempted theft; they do not establish that all cloud resources were accessed. Token analysis

Scope response to secrets readable by the host

Elastic recommends checking site-packages for agent_framework_meta.pth and af_runtime_diag.pth, pinning to the clean 1.26.0 release, and rotating long-lived keys. For short-lived tokens that cannot be revoked, review their usage activity. For network investigations, look for records of connections to webhook.site and use the full exfiltration endpoints and User-Agent provided in the report to identify activity. Response recommendations and indicators

Given the collection scope described above, reviews of shared build hosts should not be limited to a single agent project: deployment credentials, cached tokens, and secrets for other workloads that the malware could read at the time should also be inventoried. This is a response inference based on the analysis; deleting a virtual environment alone cannot revoke credentials that were exposed.

Sources

  1. Malicious code in agent-framework (PyPI)
  2. We caught the agent-framework PyPI compromise six minutes after it published
  3. malicious-packages/osv/malicious/pypi/agent-framework/MAL-2026-20101.json at 5f547b67f2daa8aa50d74a937b4c2077cccc495b · ossf/malicious-packages
  4. site — Site-specific configuration hook — Python 3.15.2 documentation