Jones Web Designs & Development is now The Jones Foundry. What it means for clients

Agent Framework PyPI package compromised to steal cloud credentials

Microsoft's open source Agent Framework package on PyPI had two malicious releases that installed a credential stealer which ran at Python startup. Security firms and PyPI quarantined the releases; developers should inspect and isolate…

Two malicious releases of Microsoft's open source Agent Framework package on the Python Package Index ran a credential stealer that executed automatically at Python startup. BleepingComputer reports the attacker published versions 1.26.1 and 1.26.2, and multiple security firms found the releases contained code that collected secrets and sent them to an attacker-controlled endpoint.

Agent Framework PyPI compromise: how it worked

Security researchers who examined the packages found the malware used Python startup hooks to run without the package being imported, so the stealer ran whenever Python started in an affected environment. According to reporting by BleepingComputer and The Hacker News, the first malicious wheel added a .pth file named agent_framework_meta.pth which caused agent_framework_meta/_telemetry.py to execute during interpreter startup. The second release restored the original initializer but added af_runtime_diag.pth and af_runtime_diag.py to achieve the same effect.

Multiple security firms documented the campaign. BleepingComputer lists Socket, Step Security, and Ox Security as among those who discovered and analyzed the releases; The Hacker News also cites Aikido, Chainguard, Endor Labs, OX Security, SafeDep, Socket, StepSecurity, and Wiz in their reporting. PyPI quarantined both releases, but BleepingComputer notes the attacker was able to publish a second malicious version roughly minutes after the first quarantine, which suggests the attacker retained publishing access after the initial takedown.

What the malicious code collected and where it sent data

Reports from Ox Security and others show the malware searched environment variables and local credential files for secrets and identity tokens used by cloud services. That includes credentials and tokens related to Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, and other services, plus Azure managed identity and Azure DevOps OIDC tokens where available. The collected data was compressed and encoded before being posted to the same hard-coded endpoint, shown in the reports as https://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb.

The second malicious release expanded harvesting to include GitHub Actions OIDC tokens and added searches of GitHub runner directories, according to The Hacker News coverage of the technical write-ups. SafeDep and other analysts pointed out the malware not only read stored credentials but also attempted to request fresh tokens from local metadata and identity endpoints, which means simply rotating stored secrets might not cover every exposure.

How to check and respond (practical steps)

If you or your team installed one of the malicious versions, take these actions promptly:

  • Stop running Python and pip in affected environments until they are secured, as the stealer runs at interpreter startup. This is recommended by BleepingComputer.
  • Isolate any environments that used the compromised wheel, and rebuild from a known-clean system. The reporting recommends reinstalling or rebuilding from a safe environment and using the last known-good release, which the reports identify as 1.26.0.
  • Rotate any credentials, tokens, or keys that might have been reachable from the compromised environment, including cloud service keys, OIDC tokens, and stored CLI credentials.
  • Search egress and network logs for requests to the attacker-controlled webhook path to determine whether exfiltration occurred, and distinguish blocked attempts from completed transfers.
  • Inspect site-packages for the .pth filenames identified in the reports, notably agent_framework_meta.pth and af_runtime_diag.pth, and check for the related Python modules that the analysts named.

These steps follow the guidance and findings published by the security teams that analyzed the packages and by the outlets reporting those findings.

Who is likely affected and why small teams should care

The Agent Framework package attracts many downloads per month, making it likely installed in both developer workstations and automated environments such as CI runners. When a malicious wheel installs a startup hook, it can run during typical developer activity or CI tasks, increasing the chance that credentials available to those environments are exposed. The Hacker News and BleepingComputer coverage stresses that the stealer ran on interpreter start, which means even running commands like pip in an affected environment could trigger the payload.

Small businesses, nonprofits, and public sector teams should treat this as a supply-chain compromise that can reach beyond a single repository. Any environment that runs Python and has cloud service credentials, stored tokens, or mounted build service identities should be reviewed if the Agent Framework package was installed there.

What to do next and where to get help

Confirm whether your projects or CI systems installed Agent Framework 1.26.1 or 1.26.2. If they did, follow the isolation, rebuild, and credential rotation steps above. Look for the specific .pth filenames and the webhook path in logs as indicators of compromise. BleepingComputer contacted Microsoft for details about how the publisher account was accessed but had not received a response by publication time; the security firms that published analyses are the best technical sources for indicators of compromise.

If you want a quick external check of your email environment or help assessing exposure related to cloud accounts and tokens, start with a free external scan on our security page: /security.html. For development teams, restore toolchains from known-clean images and update your dependency controls so you can pin packages and block unexpected publishes.

For now, treat any shared credentials that could be reached from development machines and CI runners as potentially exposed and rotate them accordingly. The reporting shows this attack used startup hooks to reach wide across Python environments, so a cautious, methodical response is the safest route.

Sources

This post was drafted with AI from the reporting linked above and published by The Jones Foundry. For full details, read the original sources.

Found this useful? Pass it on to someone who would want to know.

All Online Security posts →