Decoding the world of cybersecurity

Malicious Microsoft Agent Framework packages steal credentials

Attackers published two compromised versions of Microsoft’s Agent Framework Python package, embedding credential-stealing code that could execute during ordinary development and build operations.

Malicious Microsoft Agent Framework packages steal credentials
Summary
  • Versions 1.26.1 and 1.26.2 of Microsoft's official `agent-framework` package were compromised on 17 November.
  • A malicious Python startup mechanism targeted cloud credentials, developer tokens, and CI/CD environments.
  • Both versions were quarantined, but organisations that installed them face potential credential exposure even after replacing the packages.

Attackers compromised the distribution of Microsoft’s Agent Framework Python package, publishing two malicious versions capable of stealing cloud credentials and development secrets from systems that installed the software.

Versions 1.26.1 and 1.26.2 of the official agent-framework package appeared on the Python Package Index (PyPI) on 17 November 2026. Security researchers identified malicious code embedded in both releases, designed to execute when Python started rather than waiting for an application to import the framework.

The attack placed developer workstations, automated build systems, and cloud deployment environments at risk because those systems frequently hold credentials capable of accessing repositories, infrastructure, and software delivery services.

Independent investigations by StepSecurity, Elastic Security Labs, and JFrog established the presence of the malicious functionality. Both compromised releases have since been quarantined.

Startup mechanism bypassed normal application execution

Microsoft Agent Framework is an open-source development framework for building and orchestrating AI agents. Developers obtain its Python distribution through PyPI, making the package registry part of the framework’s software delivery chain.

The malicious releases contained a Python .pth file that could trigger execution when the interpreter started. Such files are ordinarily processed as part of Python environment initialisation, and their behaviour is not limited to applications that explicitly import the package containing them.

Installing the affected package did not itself require the malicious code to execute immediately. The next Python process started in the compromised environment could activate the mechanism, including commands associated with testing, development, and automated builds.

That behaviour increased the number of opportunities for the payload to run. A developer could install the dependency for legitimate work and subsequently execute an unrelated Python command, triggering functionality that had no legitimate connection to the intended application.

JFrog’s investigation found that the malicious code targeted credentials associated with Azure, Azure DevOps, GitHub Actions, and other development services. Such credentials can provide access to source repositories, deployment pipelines, cloud resources, or associated automation, depending on the permissions assigned to the affected identities.

Elastic Security Labs reported identifying the first malicious version approximately six minutes after its publication. The speed of detection did not prevent the appearance of a second compromised release, demonstrating that removing one package version was insufficient while the underlying publishing access remained vulnerable.

Trusted publishing channels created downstream exposure

The compromise concerned releases distributed under the legitimate package name. It was not simply a similarly named malicious dependency intended to deceive developers into installing the wrong software.

That distinction complicates conventional dependency assurance. Organisations may permit packages from recognised publishers while blocking unknown or unapproved dependencies, but such controls cannot establish that every new release from a trusted account has been produced through an uncompromised process.

JFrog reported that the affected package was downloaded approximately 40,000 times per week under normal circumstances. That figure describes the package’s general usage rather than the number of installations of either malicious release.

The published investigations have not established how many downstream organisations executed the malicious code or whether every environment containing an affected version exposed usable credentials.

Nevertheless, software build environments deserve particular attention because they often handle secrets required for deployment. A compromised build runner may contain credentials capable of publishing additional packages, modifying repositories, or accessing cloud infrastructure beyond the immediate project.

The consequences depend on credential scope and lifetime. A narrowly restricted, short-lived token creates a different exposure from a long-lived credential with broad administrative privileges, even when both are collected by identical malicious code.

Removing the package does not revoke stolen access

Both malicious versions were quarantined, preventing ordinary retrieval through the package registry. Developers who previously installed them still need to establish whether Python subsequently executed in the affected environment.

Replacing the package with a verified release addresses the malicious dependency, but any credentials already transferred outside the system remain potentially usable until they expire or are revoked.

Incident investigation therefore involves identifying affected environments, checking their execution history, reviewing relevant cloud and development activity, and determining which secrets were accessible when the malicious code may have run.

Where credentials provided access to release automation, organisations must also establish whether unauthorised changes were made to software or infrastructure during the exposure period.

The incident illustrates how a compromise of publishing access can cross from software distribution into enterprise identity and infrastructure. PyPI quarantined the two affected releases, while the full extent of downstream credential exposure remains unconfirmed.

×