Microsoft Agent Framework Malware Attack Exposes Critical Weakness in AI Software Supply Chains

· · Views: 2,046 · ⏱ 3 min time to read

Two malicious versions of Microsoft’s Agent Framework Python package were distributed through the official Python Package Index (PyPI) on November 17, exposing developers to credential-stealing malware designed to target cloud services and automated development environments.

The compromise documented by StepSecurity on November 18 affected versions 1.26.1 and 1.26.2 of the agent-framework package.

Both versions have since been quarantined, but researchers warned that affected installations could continue executing malicious code even after the packages were removed from the registry.

The incident highlights an increasingly serious challenge for software companies: widely trusted development dependencies can become entry points into cloud infrastructure and sensitive credentials.

Malicious Versions Published Within 33 Minutes

According to StepSecurity researcher Rohan Prabhu, the first malicious release, version 1.26.1, appeared at 20:35 UTC on November 17.

PyPI quarantined it approximately 31 minutes later.

However, attackers uploaded version 1.26.2 at 21:08 UTC, shortly after the first version was blocked.

The second version was quarantined about eight minutes later.

The JFrog Security Research investigation reported that the legitimate package receives approximately 40,000 downloads weekly, demonstrating its importance within AI development workflows.

That download figure represents ordinary package activity, not the number of developers who installed the malicious releases.

Researchers have not established the full extent of successful credential theft.

Malware Executed During Python Startup

Microsoft Agent Framework is an open-source toolkit for building and coordinating AI agents.

The malicious packages introduced executable .pth files into Python’s installed-package directory.

These files can run instructions during Python interpreter startup, allowing malicious code to execute without applications explicitly importing the affected framework.

Security researchers identified the payloads as credential stealers targeting environment variables, local configuration files and cloud authentication information.

According to Wiz researchers Rami McCarthy, Scott Piper and Benjamin Read, the malware attempted to access credentials associated with Microsoft Azure, Azure DevOps and GitHub Actions.

The malicious code could also request temporary identity tokens from certain cloud environments when the necessary permissions were available.

Both packages sent collected information toward an attacker-controlled endpoint.

However, researchers have not independently established that every attempted transfer succeeded.

Attack Exposes Weaknesses in Dependency Trust

The GitHub Advisory Database classified both affected releases as malicious, identifying credential exfiltration and abuse of Python startup mechanisms.

Investigators found that the compromised versions retained dependencies associated with the legitimate framework.

Consequently, applications could continue operating normally while the malware executed in the background.

The precise initial mechanism that enabled unauthorized publishing has not been conclusively established.

The incident demonstrates why software integrity requires more than checking whether a package comes from a familiar publisher.

Developers Urged to Rebuild Affected Environments

Security researchers recommended that developers who installed either compromised version isolate affected environments before executing Python commands.

Simply uninstalling the package may not prevent an already running malicious process from continuing.

StepSecurity’s remediation guidance recommends rebuilding systems from a known-clean base, checking dependency records and rotating potentially exposed credentials.

Version 1.26.0, released November 12, was identified as the last known-clean release at the time of the investigation.

Security teams were also advised to examine CI/CD logs, cloud access permissions and outbound connections associated with the malicious packages.

For engineering teams building AI applications, the attack reinforces the importance of dependency pinning, software provenance verification and restrictive permissions.

As AI development increasingly depends on interconnected open-source frameworks, protecting the software supply chain becomes essential to protecting the cloud systems those frameworks can access.

Share
f 𝕏 in
Copied