Microsoft AI Python Package Compromised with Azure and GitHub Credential Stealer

Rajesh Rai
4 Min Read


Follow us on Google News


Follow The420.in on Google News

Cybercriminals compromised Microsoft’s official Python package agent-framework on November 17, 2026, uploading two malicious versions embedded with a credential stealer. Versions 1.26.1 and 1.26.2 were published to the Python Package Index (PyPI) at 20:35 UTC and 21:08 UTC, respectively, before being quarantined and removed by 21:30 UTC. The package, used to build artificial intelligence agents, averages roughly 41,000 downloads a week, or nearly 200,000 a month. Security researchers at Wiz discovered the breach and notified Microsoft, advising developers to pin installations to the latest safe version, 1.26.0.

​Automatic Execution on Python Startup

​Technical analysis revealed that installing either compromised version placed a malicious .pth file directly into the Python site-packages root directory. Version 1.26.1 dropped agent_framework_meta.pth, while version 1.26.2 used af_runtime_diag.pth. Because Python automatically executes .pth files every time the interpreter starts, the malware ran whenever Python was launched in an affected environment, even if the developer never imported agent-framework in their code.

​To evade detection during routine inspections, the attackers disguised the malicious files and functions as standard runtime diagnostics and telemetry hooks. Once triggered, the payload scanned system environment variables for terms such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, and OPENAI. It also extracted secrets from the environment variables of up to 300 running processes and harvested up to 80 local credential files, including Azure CLI configurations, .npmrc, pip.conf, .docker/config.json, .git-credentials, and .env files.

​Targeting Azure and GitHub Pipelines

​The credential stealer was specifically engineered to compromise cloud infrastructure and continuous integration workflows. It queried Azure Instance Metadata Service endpoints for managed-identity tokens across 12 Azure services, including Key Vault, Storage, and Azure AI/ML, alongside Azure DevOps access tokens. In version 1.26.2, the attackers expanded the payload to target GitHub Actions workflows configured with id-token: write permissions, allowing the malware to request OpenID Connect (OIDC) tokens that could be exchanged for unauthorized Azure access.

​Investigators traced the unauthorized package publication to a compromised client certificate and private key belonging to Microsoft’s Engineering System Release Pipeline (ESRP), the internal system used to sign and publish releases. Using an open-source AI penetration-testing framework called Cairn, the attackers initially attempted to publish from an Amazon Web Services address but were blocked by ESRP’s IP filtering. A subsequent upload attempt originating from a Microsoft-owned IP space succeeded, though it remains unclear how the signing credentials were obtained.

​Limited Impact and Remediation Steps

​The malware compressed all harvested data and transmitted it via HTTPS to a hardcoded URL on webhook.site, a public request-inspection service. Because the attackers used a free-tier endpoint with strict storage limits, researchers were able to inspect the 50 captured requests. Four requests originated from the attackers’ own infrastructure during testing, and 29 came from security sandboxes and automated scanners. The remaining 17 requests represented three unique victim environments where valid cloud and registry credentials were successfully exfiltrated.

​Security teams are urged to audit lockfiles, container images, and build logs for versions 1.26.1 and 1.26.2 and downgrade immediately to 1.26.0. Researchers emphasized that removing the package alone is insufficient, as exposed secrets remain valid. Organizations must rotate all environment variables, personal access tokens, and registry credentials on affected hosts, while reviewing Azure and Entra ID sign-in logs for unauthorized token exchanges.