Advisory

MAL-2026-20101

Also known as: None

Malicious package Its source marks this package as malicious: it is not a vulnerability in a legitimate one.

Summary

Malicious code in agent-framework (PyPI)

Details

Malicious releases of the legitimate "agent-framework" package (Microsoft Agent Framework). Versions 1.26.1 and 1.26.2 add a credential stealer that is not present in the last clean release, 1.26.0. Both releases were published on 2026-11-17 (1.26.1 at 20:35 UTC as a wheel only, 1.26.2 at 21:08 UTC) and have since been removed from PyPI.

How it triggers: each wheel adds an executable .pth startup hook that imports a helper module. Python runs .pth files at every interpreter start, so the code executes as soon as the package is installed, without importing agent_framework. In 1.26.1 the files are agent_framework_meta.pth and agent_framework_meta/_telemetry.py, started from a hook added to agent_framework_meta/__init__.py. In 1.26.2 they are renamed to af_runtime_diag.pth and af_runtime_diag.py; agent_framework_meta/__init__.py is identical to the clean 1.26.0 and the module calls its own _start() on import, so the .pth is the only trigger. The helper detaches into a background process (os.fork, os.setsid), is guarded by the environment marker _AF_TEL, and silences all errors. The rest of the wheel matches 1.26.0 and the dependency is unchanged (agent-framework-core[all]==1.26.0).

What it does (info stealer): it collects hostname, user, working directory and arguments; environment variables whose names contain TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, HF_, OPENAI, NPM, PIP or CI_; the environment of other processes (/proc/*/environ); credential files (~/.azure, .npmrc, .netrc, .git-credentials, .docker/config.json, Hugging Face token, Azure DevOps agent .credentials, .env files); Azure DevOps OIDC tokens (SYSTEM_ACCESSTOKEN, SYSTEM_OIDCREQUESTURI); and Azure managed-identity tokens from the instance metadata service (169.254.169.254, IDENTITY_ENDPOINT). 1.26.2 adds theft of GitHub Actions OIDC tokens (ACTIONS_ID_TOKEN_REQUEST_URL, ACTIONS_ID_TOKEN_REQUEST_TOKEN, ACTIONS_RUNTIME_TOKEN), adds the /home/runner paths, and raises the limit on captured files from 60 to 80.

Exfiltration: the data is compressed with zlib, base64-encoded and sent by HTTP POST to https://webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. The URL is stored base64-encoded (_ENC) and is identical in both releases. The User-Agent is af-runtime-diagnostics/1 in 1.26.1 and runtime-diagnostics/1 in 1.26.2.

Wheel sha256: 1.26.1 d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110; 1.26.2 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9.

Anyone who installed 1.26.1 or 1.26.2 should treat the environment as exposed and rotate the credentials reachable from it, including CI and GitHub Actions secrets. 1.26.0 and earlier are not affected. We have not attributed this to a known campaign.

---
_-= Per source details. Do not edit below this line.=-_

Source: amazon-inspector (72f7549a69d5529aca2fb787d2fbb62f94e73afd9ca1a832608687e1d185e594)
The wheel ships agent_framework_meta.pth containing import agent_framework_meta, which runs on every Python interpreter start (not just on import agent_framework). The imported module spawns a background thread that harvests installer-side secrets and POSTs a base64+zlib-compressed payload to https://webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb, whose URL is concealed as a base64 literal (_ENC) decoded at runtime. Collection includes: environment variables matching TOKEN/SECRET/PASSWORD/KEY/AZURE/AWS/GITHUB/OPENAI patterns; credential files ~/.azure, ~/.npmrc, ~/.netrc, ~/.git-credentials, ~/.docker/config.json, Hugging Face tokens; /proc/[0-9]*/environ scraping of other processes; Azure IMDS (169.254.169.254) and App Service IDENTITY_ENDPOINT managed-identity token requests across multiple resource audiences (management.azure.com, vault.azure.net, graph.microsoft.com, storage, etc.); and an ADO OIDC token-exchange POST using SYSTEM_ACCESSTOKEN against SYSTEM_OIDCREQUESTURI. Package metadata impersonates Microsoft and mimics the real microsoft/agent-framework README as cover. The name resembles the legitimate Microsoft package.

Source: kam193 (7170b55e6541c89d914a388534b7ccaeb303abb46def27bda667f5ad2051ed5d)
Versions 1.26.1, 1.26.2 were compromised.

Compromised versions use PTH file to trigger malicious actions on every Python process startup. It then exfiltrates environment variables, credential files and tokens from cloud metadata endpoints.

---

Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers.

Campaign: 2026-11-compr-agent-framework

Reasons (based on the campaign):

  • exfiltration-env-variables
  • obfuscation
  • exfiltration-cloud-tokens
  • exfiltration-credentials
  • compromised-package
  • abuses-pth

Severity

Not rated by the source.

Dates

Published
2026-11-17 22:12 UTC
Modified
2026-11-17 23:15 UTC

Affected packages and fixes

agent-framework

PyPI · All systems

Affected

  • Versions: 1.26.1, 1.26.2

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: OpenSSF Malicious Packages · Apache-2.0

Sources & licences