What Happened: Timeline and Scope
Two malicious versions of the agent-framework package, numbered 1.26.1 and 1.26.2, were published to PyPI just 33 minutes apart. The malware was designed to execute a credential stealer every time Python started on an infected system, giving attackers persistent access to cloud authentication tokens and API keys. This type of attack is called a supply chain compromise because it targets a trusted library that thousands of developers rely on, rather than attacking individual users.
The compromise was detected and reported by multiple security vendors working together: Aikido, Chainguard, Endor Labs, OX Security, SafeDep, Socket, StepSecurity, and Google-owned Wiz. This coordination suggests the attack was significant enough to trigger alerts across the security industry's monitoring systems. The fact that multiple independent teams caught it quickly also indicates that the malicious package did not stay live for very long before PyPI removed it.
How Supply Chain Attacks Through Package Repositories Work
Package repositories like PyPI are central to how modern software is built. Developers list dependencies in a file, and tools like pip automatically download and install thousands of packages. When an attacker gains control of a package, they can inject malicious code that runs on every machine that installs it. The agent-framework package is linked to Microsoft's development tools, so it likely had a substantial number of regular users and automated deployments.
Credential stealers are particularly dangerous in this context because they target authentication material rather than data or systems directly. Once a threat actor has a developer's cloud credentials, they can access repositories, databases, and production infrastructure tied to that developer's account. The malware was set to run on Python startup, meaning it would execute silently every time a developer used Python on their machine, establishing a persistent backdoor for credential harvesting.
How Attackers Gain Control of Legitimate Packages
Threaten actors typically compromise packages through one of these routes: they obtain the account credentials of a package maintainer through phishing or credential reuse, they exploit weak authentication on an old account, or they compromise the maintainer's development environment and inject malware into the code before it is published. In some cases, a package may be abandoned but still actively installed by thousands of users, and attackers take it over because it lacks any active oversight.
Once an attacker has publishing access, they can upload new versions faster than humans can review them. This is why the two malicious versions appeared 33 minutes apart; the attacker was publishing them rapidly to maximize installations before detection. Package repositories have since improved their abuse monitoring, but the speed advantage still favors attackers in the first few minutes after a malicious package goes live.
How Developers Can Detect and Respond to This Type of Attack
If you use Python packages, check the following to protect yourself after an incident like this:
- Review your package versions against security advisories published by the Cybersecurity and Infrastructure Security Agency (CISA) and the Python Packaging Authority
- Check your pip freeze or requirements.txt logs to see which versions of agent-framework you installed and when
- If you installed versions 1.26.1 or 1.26.2, assume any cloud credentials or API keys on that machine may have been compromised
- Rotate cloud access keys, regenerate API tokens, and check cloud account logs for unauthorized activity from the affected period
- Review recent git commits and pull requests on your projects for suspicious changes made during the compromise window
- Update agent-framework to a version after 1.26.2 once the package has been verified as clean by upstream maintainers
Do not rely solely on package version numbers to confirm safety; wait for official security announcements before reinstalling.
Reality Check: How Package Compromise Fits Into Broader Threat Patterns
According to the Tor Project and open-source security research communities, supply chain attacks have become a mainstream technique because they are efficient: one compromised package can affect thousands of developers and hundreds of downstream projects simultaneously. Unlike targeted phishing or ransomware attacks that require reconnaissance of specific organizations, package poisoning is a broadcast attack that rewards the attacker based on volume of installations.
From a law-enforcement perspective, these incidents are often hard to attribute immediately because the attacker's infrastructure is usually ephemeral and separated from the actual package upload. Court records and CISA press releases on package compromise cases show that investigators typically focus on credential misuse patterns in cloud logs rather than on the package upload itself.
A second reality: many developers do not monitor or lock their package versions in production environments, meaning a single malicious release can auto-update across infrastructure without approval or awareness. Organizations that pin specific package versions or use private package mirrors have a significant defensive advantage in these scenarios.
What This Means for Your Development Workflow
This incident reinforces why supply chain security matters even if you are not a target of a state-level attack. A single compromised popular package can give an attacker access to your development machines, source code repositories, and cloud infrastructure through no action of your own.
Consider adopting these practices now:
- Use lock files (like requirements.txt with pinned versions or Poetry.lock) so that your team installs only the versions you have reviewed
- Enable notifications for security advisories on your key dependencies through tools offered by your package manager or through third-party monitoring services
- Use separate cloud credentials for development and production, and rotate development credentials monthly
- Review installed packages in your environments periodically, removing unused dependencies that increase your surface area
- If you maintain a package yourself, use strong, unique credentials for your repository account, enable two-factor authentication, and consider using signing certificates for releases
Your Next Step
If you installed Python packages on November 17 or shortly after, check your logs to see whether agent-framework 1.26.1 or 1.26.2 ended up in your environment. If you did, treat any cloud credentials on that machine as potentially compromised and rotate them now. Check the official Microsoft security advisory and the Python Packaging Authority's list of compromised packages to see which versions are safe. This single action takes 20 minutes and protects you from credential theft that could persist undetected for months.
Frequently Asked Questions
How do I know if I installed the malicious agent-framework versions?
Run pip show agent-framework or check your requirements.txt or lock file to see which version is installed. The compromised versions are 1.26.1 and 1.26.2 only. If you have neither of these, you are not affected.
Do I need to reinstall my entire Python environment?
No. Uninstall agent-framework, check your cloud account logs for unauthorized activity, rotate your credentials, and then reinstall the latest clean version of agent-framework. You do not need to reinstall other packages unless they are also flagged in a security advisory.
Can I tell if the malware actually stole my credentials?
You cannot know for certain without deep forensics, so assume it did if you installed the malicious version. Check your cloud provider's login history and API usage logs for activity you do not recognize during the time the malware was installed. If you see nothing suspicious, your credentials may not have been actively exploited, but they should still be rotated.
How do I prevent this from happening again?
Use version pinning in your production deployments, enable security monitoring on your package dependencies, and keep development cloud credentials separate from production ones. No single tool can prevent all supply chain attacks, but these practices make you a harder target.
Should I trust PyPI at all anymore?
Yes, but verify. PyPI has hundreds of millions of packages and this is one compromised release among millions. The fact that it was caught and removed quickly shows the ecosystem's detection capabilities are working. Stay aware of advisories, but do not abandon package managers; instead, use them more deliberately.
Source: The Hacker News
