PyPI withdraws 1.26.1 and 1.26.2 of agent-framework by exfiltered credentials by .pth

Author: Published 6 min de lectura 29 reading

The images in this article were generated with artificial intelligence. How we publish

Several response teams and cyber security companies have confirmed that malicious versions of Microsoft's agent-framework package published in PyPI on November 17, 2026 contained acredental stealerdesigned to run at each start of the Python interpreter and exfiltered secrets to a URL controlled by attackers. The reported versions are 1.26.1 and 1.26.2, published 33 minutes apart., and independent sources report that PyPI has quarantined these launches after the findings. The affected package is the meta-package of Microsoft Agent Framework, an open bookstore oriented to the orchestration of IA agents in Python. (See project page in PyPI: https: / / pypi.org / project / agent-framework /.)

The technical mechanism that the attackers exploited is based on a known feature of the Python load: the .pth files in site-packages may contain import lines that Python runs at each start of the interpreter. Both malicious wheels leave a .pth at the root of site-packages - agent _ framework _ meta.pth at 1.26.1 and af _ runtime _ diag.pth at 1.26.2 - with an instruction that matters a malicious module and runs it automatically. This means that the payload is activated although no code explicitly amounts agent-framework; it is enough to start Python, run pipe or any tool that the interpreter invokes in that environment.

PyPI withdraws 1.26.1 and 1.26.2 of agent-framework by exfiltered credentials by .pth
Image generated with IA.

Public analysis details what the payload collects and how it exfilters. Confirmed by multiple teams, the code seeks known credentials files (.netrc, .npmrc, .git-credentials, docker / config.json, pipe configurations, .env and certain JSON), tokens-related environment variables, and specific service files such as Azure CLI (~ / .azure / * .json) and IA / ML platform credentials. In addition, the code requests new tokens when it can: in Azure DevOps or GitHub Actions environments it tries to obtain OIDC / federated tokens and, in Azure instances, it consults the equipment's metadata service (IMDS) in the direction 169.254.169.254 to order tokens of identity administered. The official documentation of the Azure metadata service explains this endpoint: https: / / learn.microsoft.com / azure / virtual-machines / instance-methadata-service. All information collected is compressed, coded and sent by HTTPS to a public web-hook URL ( https: / / webhook.site /) which appears in the analyses.

Facts confirmed: versions 1.26.1 and 1.26.2 included malicious .pth that run code at each start of the interpreter; the compiler seeks and sends credentials and tokens (including tokens requested via IMDS and OIDC); PyPI has quarantined the affected versions; the exact names of the .pth and the exfiltration URL have been reported by several security companies.

Elements still uncertain or estimated: there is no public confirmation of how the attackers obtained the ability to publish those wheels (if it was direct commitment of publishing accounts, exploitation of the construction chain or abuse of the wheel creation flow). There are also no public figures on how many real environments were compromised: the package records about 190,000 downloads per month, suggesting a wide exposure area, but the number of facilities that received specifically 1.26.1 / 1.26.2 depends on the update windows of each environment and CI / CD.

The practical consequences are very clear and serious for affected environments. A compromised Python interpreter can filter secrets that allow access to repositories, container records, cloud services and deployment pipelines including the ability to order federal tokens from pipelines or identity tokens managed in Azure instances, which facilitates lateral movement and persistent access to cloud infrastructure. In continuous integration environments (CI runners) Python's repeated and automated execution multiplies the risk: it was enough for a single image or runner to install the malicious version to expose secrets in all subsequent executions.

If you administer systems, repositories or pipelines using Python, take immediate and orderly action. First, isolate yourself: Stop and disconnect suspicious runners and hosts to avoid further exfiltration. Second, it identifies the presence of the technical indicators: it looks in the affected environments for the agent _ framework _ meta.pth or af _ runtime _ diag.pth files in the site-packages directories and reviews their content; a good starting point is to inspect the site-packages of each virtual environment and container where Python runs. Third, replace the package with a secure version: pinnea the projects to 1.26.0 or to the latest verified version and restore environments from clean images or snapshots without the compromised version.

Fourth, he assumes that the secrets present or requested were exposed: breaks all credentials and tokens from a clean system. For Azure, this includes revoking tokens and examining activity records and sign-ins in Azure AD; if you use Azure Managed Identity, check which identities were used and consider temporarily disabling or reconfiguring them. Check workflows of GitHub Actions by use of OIDC / federation and revoke any token or credential that may have been issued in the risk window (malicious versions were published between approximately 20: 35 and 21: 20 UTC on November 17, 2026, according to reports, so that is the initial window for login engagement searches). Search in proxies / DNS requests to the exfiltration URL and block those destinations at network level if you have not already done so.

PyPI withdraws 1.26.1 and 1.26.2 of agent-framework by exfiltered credentials by .pth
Image generated with IA.

In addition, it has reiterated the supply chain and the security of the publication accounts: projects and holders with rights in PyPI must enable 2FA, review the publication permits and logs and validate their wheel creation processes. To protect automated deployments, add integrity controls: use package hashes with --require-hashes in pipe, verify device signatures when possible and minimize the capabilities of the runners (prevent CI runners from exposing permanent credentials or with broad privileges). Python's official documentation describes the behavior of the .pth and why they are executed at each start, which helps explain why this technique is effective: https: / / docs.python.org / 3 / library / site.html.

This is not the first time that Microsoft-related packages in PyPI have been abused: in May 2026 there was another incident with the durable bookstore. This highlights that attackers are specifically targeting the package ecosystem and CI / CD pipelines that support IA and automation projects. For response teams and security architects the lesson is clear: to reduce the exposure of secrets in building environments, to segment networks and to enable telemetry that detects anomalous peaks of requests to external endpoints or mass creation of artifacts.

Finally, and even if the immediate action is to contain and rotate credentials, it is essential to document and learn from the incident: record chronologies, pieces of evidence (.pth capture, malicious wheel hashes), notify development teams and cloud and policy suppliers to prevent a single PyPI unit from turning an environment into a back door. The security community has published technical and observable analyses that facilitate search and containment; act quickly and from clean systems.

Coverage

Related

More news on the same subject.