← Journal
Security

Malicious agent-framework versions on PyPI collected Azure and GitHub tokens

XORit Editorial · Sources, AI assistance and corrections

Вредоносные версии agent-framework в PyPI собирали токены Azure и GitHub

On November 17, 2026, versions 1.26.1 and 1.26.2 of the agent-framework package for Python, which Microsoft publishes, were compromised on PyPI. Both versions add a file with a .pth extension during installation, and Python picks up such a file on every start of the interpreter. The malicious code runs in a background process or a separate thread and collects secrets without user involvement. The research team at Socket published the analysis.

The mechanism differs between the versions. In 1.26.1 the chain runs from the agent_framework_meta.pth file through the package initializer to the _telemetry.py module, where so-called diagnostic loading with error suppression is embedded. In 1.26.2 the af_runtime_diag.pth file imports a separate af_runtime_diag.py module, and the package's regular initializer is restored to its original form. Therefore checking only the __init__.py file will not reveal the second version.

Collection proceeds in several directions. The code selects environment variables by substrings in their names, among them TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI, HF_, FOUNDRY, TENANT, CLIENT and MANAGED, reads the environment of other processes via /proc, as well as files with credentials. The list includes Azure configurations, Azure DevOps agent data, pip.conf, .npmrc, .netrc, .git-credentials, Docker configuration, the Hugging Face token, Foundry files and variables from .env in application directories.

Besides copying existing secrets, both versions request fresh cloud identity tokens: Azure managed identities and Azure DevOps federation tokens. Version 1.26.2 adds GitHub Actions OIDC tokens via the ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN variables with the ACTIONS_RUNTIME_TOKEN fallback, as well as GitHub runner files. The collected data is serialized, compressed with zlib and encoded in Base64, after which it is sent in a POST request to a hidden webhook.site address with the t=telemetry parameter. The encoding protects nothing here; HTTPS remains the only layer of encryption.

The practical conclusion is simple: versions 1.26.1 and 1.26.2 must not be installed, and if they are already installed, they must be removed and the environment checked. All secrets that could have reached the collector should be considered exposed and replaced: tokens, keys, cloud account data. The report's authors provide SHA256 hashes for both wheel files and individual modules, including agent_framework_meta.pth and af_runtime_diag.pth, so that it is possible to check what exactly is installed.

The report separately notes that the samples studied contained no code that would download and run additional modules. This limits the set of actions of the malicious code, but does not negate the fact that credentials may already have been sent outside, and fresh tokens issued on the cloud side.

Image:

Translation editors: Соловьев В., Пеков А.

Source: socket.dev ↗

← All newsRead XORit on Telegram ↗

Request a call
or contact us

Request a call

    How data is processed · SmartCaptcha data notice

    Your request has been successfully
    sent

    We will contact you shortly,
    to discuss cooperation details

    An error occurred
    while sending the form

    Please try again later
    or contact us directly: