Skip to content
AI.info

The Pulse

Malicious Microsoft Agent Framework releases removed from PyPI

Two malicious versions of Microsoft's agent-framework Python package contained a credential stealer that ran when Python started, according to Wiz. Both releases were no longer available on PyPI by 21:30 UTC on November 17.

Malicious Microsoft Agent Framework releases removed from PyPI

Two malicious releases of Microsoft's agent-framework Python package carried a credential stealer that ran whenever Python started in an affected environment, according to security company Wiz. Both releases were no longer available on the PyPI package index by 21:30 UTC on November 17.

Source wiz.io

The first malicious release, version 1.26.1, appeared at 20:35 UTC; version 1.26.2 followed at about 21:08 UTC. The package gets about 41,000 downloads a week, and Wiz identified 1.26.0 as the most recent safe version.

What Wiz says happened

In an update on November 18, Wiz said the attacker appears to have compromised a client certificate and private key for Microsoft ESRP (Engineering System Release Pipeline), the internal service Microsoft uses to sign and publish the package. How the credentials were obtained is not yet known, Wiz said.

Wiz noted that another Microsoft Python package, durabletask, was compromised earlier this year after its PyPI token was stolen. The company has not linked the incidents.

Credentials targeted

When either malicious version was installed, it placed a file in the Python environment's site-packages root, according to Wiz. Python runs such .pth files at interpreter startup, so the stealer ran even if the agent-framework package was never imported.

The stealer focused on Azure and Azure DevOps, collecting environment variables with names associated with credentials and services including AWS, GitHub, OpenAI and Hugging Face. It also sought secret-looking values from up to 300 other processes' environment files and looked for credential files, including Azure CLI and package-manager credentials.

The payload also requested certain Azure DevOps and managed-identity tokens when the required conditions were present. Collected data was compressed, encoded and sent in a single HTTPS request to a hardcoded webhook.site address; failures were silently ignored and not retried, Wiz reported.

The second malicious release was a repack of the first that sent data to the same address. It used a different startup file and module, expanded the environment variables and paths searched, and raised the credential-file limit from 60 to 80.

It also added requests for GitHub Actions OIDC tokens in workflows with the relevant permission, according to the researchers. Where an Entra ID federated credential trusts the workflow, those tokens can be exchanged for Azure access without a stored secret.

Captured requests and response

The attacker used a free-tier webhook.site token, Wiz said, and a maximum of 50 requests were captured. Those requests can contain working cloud, CI and registry credentials.

A free-tier URL not attached to an account accepts at most 100 requests and expires after seven days, according to the company. After the request limit, new requests receive an error and are not logged.

Wiz recommended that security teams search lockfiles, CI logs, virtual environments and container images for the two malicious versions, check for their startup files and inspect network logs for the destination. For affected hosts and runners, it advised rotating exposed credentials and reviewing activity for reachable Azure identities and federated credentials.

The company also recommended reviewing affected GitHub Actions workflows and the Entra ID credentials that trust them. Stolen managed-identity and OIDC-exchanged tokens are valid for up to 24 hours, it said.

Source

  1. Wiz

Companies in this story

Related stories

Explore

More articles