CYBERRAKSHAK LABS · RESEARCH #096

🚨 Microsoft Agent Framework PyPI Supply-Chain Compromise

CyberRakshakLabs | Research • Awareness • Safer Digital India

Prepared 18 November 2026 · Source-led technical research
RESEARCH#096
CATEGORYSoftware Supply Chain / Cloud Security
FOCUSPYPI · PYTHON STARTUP HOOKS · CLOUD / CI/CD CREDENTIALS
CONTENT TYPETechnical Research
PUBLISHED2026-11-18
How CyberRakshakLabs researches threats →
Executive summary

On 17 November 2026, two malicious releases of Microsoft’s Python package agent-framework—versions 1.26.1 and 1.26.2—were published to PyPI approximately 33 minutes apart. They added Python startup hooks that executed credential-stealing code whenever Python started in an affected environment; importing Agent Framework was not required.

The payload targeted cloud and development credentials, including Azure managed-identity tokens, Azure DevOps credentials and, in version 1.26.2, GitHub Actions OIDC material. Researchers reported exfiltration to a webhook[.]site endpoint. Both malicious releases were subsequently removed/quarantined; 1.26.0 is identified as the last clean release.

Research infographic summarizing malicious PyPI releases, Python startup hook execution, credential targets and webhook.site exfiltration
Figure 1. Supplied executive-summary infographic showing the affected package, startup execution, credential targets and exfiltration path.
Article controls
Scope and Package Context

The affected artifact was the agent-framework PyPI meta-package, not evidence that every Microsoft Agent Framework package or Microsoft service was compromised. Endor Labs reported that the 22 sibling agent-framework-* packages it checked had not received new releases since 12 November. The malicious versions pinned the legitimate core package at 1.26.0, potentially allowing applications to continue functioning.

Researchers cited approximately 190,000 monthly downloads. This is package-popularity context, not a verified count of affected installations or victims. Public sources reviewed do not establish how many organizations installed either malicious version.

Public evidence snapshot of the Microsoft Agent Framework PyPI compromise
Figure 2. Supplied evidence snapshot. Package scope, execution, credential targets, timeline and attribution caveats are shown.
Technical Attack Mechanism

The malicious releases added executable .pth startup hooks to Python’s site-packages. Python processes import lines in .pth files during interpreter startup.

  • Version 1.26.1: used agent_framework_meta.pth to load agent_framework_meta/_telemetry.py.
  • Version 1.26.2: moved the loader to af_runtime_diag.pth and payload to af_runtime_diag.py, complicating simple detection based on the first release’s file changes.

The hook executes when Python starts in the affected environment, including Python-based package-management commands. It does not require the application to import Agent Framework. Researchers observed a detached process on Unix-like systems, allowing collection to continue after the initiating interpreter exited.

Reported collection included selected environment variables, credential/configuration files and other process environments visible through /proc. The payload sought Azure managed-identity tokens for multiple resources, Azure DevOps tokens and, in 1.26.2, GitHub Actions OIDC tokens. Collected material was transmitted to webhook[.]site. Exposure depends on host permissions, available files, environment variables and workload identity configuration.

Attack flow diagram showing supply-chain compromise, installation, automatic execution, credential discovery, exfiltration and potential follow-on
Figure 3. Supplied attack-flow diagram. Follow-on abuse is identified as a potential outcome, not a confirmed result in every environment.
Attack Timeline (UTC)
  • 12 Nov 2026, 18:24–18:26: legitimate agent-framework 1.26.0 and related framework packages published.
  • 17 Nov 2026, 20:35:20: malicious 1.26.1 published as a wheel-only release.
  • 17 Nov 2026, 21:08:39: malicious 1.26.2 published, with the startup hook and payload relocated.
  • 17 Nov 2026, around 21:13: researchers reported 1.26.2 live while 1.26.1 had been removed from the index.
  • 17 Nov 2026, around 21:20: Aikido reported both versions removed and 1.26.0 restored as latest. Microsoft project maintainers acknowledged the versions had been pulled and said investigation was underway.
Threat Actor and Attribution

Public reporting establishes malicious package publication and credential-theft behavior, but not the operator’s real-world identity, organization, nationality or motive. Researchers discussed potentially compromised publishing access and a newly created maintainer account; these are investigative indicators, not proof of a named actor. Attribution remains unknown.

Likely operational objectives include gaining access to cloud environments and software delivery pipelines through stolen credentials and identity tokens. Subsequent cloud, repository, pipeline, package-registry or artifact abuse is a plausible risk, not confirmed downstream activity in every victim environment.

Indicators of Compromise
  • Malicious versions: agent-framework==1.26.1 and agent-framework==1.26.2.
  • Startup hooks: agent_framework_meta.pth and af_runtime_diag.pth.
  • Payload files: agent_framework_meta/_telemetry.py and af_runtime_diag.py.
  • Observed exfiltration service: webhook[.]site. Researchers published specific endpoint paths, hashes and User-Agent strings; validate exact indicators against current threat-intelligence sources before operational blocking.
  • Behavioral clues: Python processes reading many /proc/*/environ files, Python outbound traffic to webhook.site, unexpected cloud identity token requests, and CI jobs installing unpinned package versions.
Impact and Risk

Any host or runner that installed either malicious version during the exposure window should be treated as potentially compromised. This includes developer workstations, CI runners, build containers, Azure workloads and hosts with accessible credentials.

Stolen credentials may enable unauthorized access if still valid and sufficiently privileged. Short-lived tokens may expire, but long-lived secrets, service connections, repository tokens, refresh credentials and cached artifacts may remain relevant. Removing the package stops future execution but does not reverse data already exfiltrated.

Defensive Actions and Incident Response
  1. Identify affected versions across endpoints, virtual environments, CI runners, container images, caches and internal package mirrors. Review lockfiles, build logs, SBOMs and package records.
  2. Do not launch Python or pip in an affected environment before removing the malicious startup hooks; Python-based tools may trigger them. Follow a vetted cleanup procedure from a clean administrative shell, then reinstall known-good 1.26.0 with hash verification. Rebuild images and purge caches/mirrors.
  3. Isolate affected runners/hosts where feasible and preserve logs and forensic artifacts.
  4. Rotate potentially exposed secrets from a clean environment: Azure service principals, managed-identity dependent access, Azure DevOps tokens/service connections, GitHub tokens/OIDC trust, package-registry credentials, cloud keys and .env secrets.
  5. Review Entra sign-in/audit logs, Azure activity, Azure DevOps pipeline activity, GitHub Actions runs, repository changes, artifact/cache writes and egress/DNS/proxy logs from 17 Nov 20:35 UTC onward.
  6. Inspect workflows that expose runtime/cache tokens or grant id-token: write; clear suspect caches after evidence collection.
  7. Enforce exact dependency pins and hash-locked builds, verify provenance, scope publishing credentials tightly, and monitor unexpected .pth files.
Confirmed vs. Not Established

Confirmed by multiple researchers: two malicious PyPI releases, automatic startup execution through .pth files, credential collection targeting cloud/CI identities, and subsequent removal/quarantine.

Not established in the public sources reviewed: total installations, affected organizations, amount exfiltrated, successful use of stolen credentials, complete compromised-identity list, or a named threat actor. Organizations must determine exposure from their own telemetry.

References and Source Notes

The analysis follows the supplied source hierarchy and confidence statements. The sources describe malicious package publication, startup-hook execution and credential collection; they do not establish a total victim count or named actor attribution.

Analyst caveat: This report separates observed technical behavior from potential impact. It does not establish a total victim count, successful downstream abuse in every case, or named threat-actor attribution.