Skip to main content

    CybersecurityAnalysis

    Two malicious releases of Microsoft's Agent Framework hit PyPI with a credential stealer

    Versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package on PyPI carried code that ran on every Python start and sent cloud and CI/CD secrets to an outside address. Both were removed within about 45 minutes.

    Sonomos NewsroomPublished 3 min read
    33 minutesbetween the twomalicious releases

    Two malicious versions of agent-framework, Microsoft's Python package for building AI agents, were published to PyPI on November 17 and carried code that collected cloud, source-control and CI/CD secrets and sent them to an outside web address. According to Aikido Security's timeline, version 1.26.1 appeared at 20:35 UTC, 1.26.2 followed 33 minutes later, and both were gone by 21:20 UTC.

    The compromise was analysed by Socket's research team, which lists the two affected versions as 1.26.1 and 1.26.2.

    What did the malicious versions do?

    Both versions used Python .pth files, which the interpreter processes at startup, to launch a credential collector. Aikido says that means the code ran whenever Python started, whether or not the package was ever imported. On Linux and macOS the payload forks into a detached background process; on Windows it runs as a daemon thread.

    Socket and Aikido describe the collection in similar terms:

    • environment variables whose names look secret-like, and, per Aikido, values from up to 300 other processes read through /proc;
    • credential and configuration files for Azure, Azure DevOps agents, pip, npm, Git, Docker, Hugging Face and application .env files;
    • fresh tokens requested rather than only copied: Azure managed-identity tokens (Aikido says for 12 Azure resources) and Azure DevOps OIDC tokens.

    The data was compressed, Base64-encoded and sent by HTTPS POST to a webhook.site address. Socket notes that this encoding adds no confidentiality beyond HTTPS.

    How do the two versions differ?

    1.26.11.26.2
    Startup hookagent_framework_meta.pth, which loads a modified agent_framework_meta/__init__.pyaf_runtime_diag.pth, which loads af_runtime_diag.py
    Original __init__.pyModifiedRestored unchanged, so checking only that file misses this version
    Added targetingOne extra Azure DevOps agent credentials pathGitHub Actions OIDC tokens and wider GitHub-related targeting
    Credential file limit (Aikido)6080

    How did the attacker publish them?

    Aikido says the 1.26.1 wheel appears to have been unpacked, edited by hand and re-uploaded, and that the attacker used valid publishing credentials. It says how the attacker obtained them is not known. Neither source quotes a statement from Microsoft; Socket's write-up gives no removal timeline, and Aikido's page contains no maintainer statement.

    What does it mean for people who installed it?

    Aikido sets out what its analysis implies. Because the payload targets build and deployment identities, any secret reachable from a machine that installed either version, including CI runners and container images built since November 17, is treated as exposed. Removing the package stops future execution but does not undo data already sent. It recommends pinning agent-framework==1.26.0, checking site-packages for either .pth file, reviewing Entra ID sign-in logs for the service principals and federated credentials pipelines use, and searching proxy and DNS logs for connections to webhook[.]site. Socket's recommendations match: avoid both versions, remove them and rotate possibly exposed credentials.

    These are the vendors' recommendations; neither source cites a legal notification duty. Whether a given organisation has one depends on what data its exposed credentials could reach.

    Why does it matter that this is an AI framework?

    Agent frameworks tend to run where credentials are plentiful: developer machines and pipelines that hold cloud identities, model-provider keys and Hugging Face tokens. The package gets about 190,000 downloads a month, according to Aikido. The incident is a software supply-chain compromise rather than a flaw in a model, but it shows how the tooling around AI agents becomes a path to the secrets those agents use. For how agents interact with private data, see AI agents and data privacy; for the model-side version of the problem, see the glossary entry on prompt injection.

    Earlier this month the newsroom covered a related pattern in the Fireworks AI breach, where credentials and datasets held by an AI infrastructure provider were taken.

    What is unresolved?

    The sources do not establish how the publishing credentials were obtained, how many machines installed the versions in the roughly 45-minute window, or whether any stolen secrets were used. Microsoft's own advisory is not cited here because the sources opened for this story did not link one.

    Sources

    1. 1
      Microsoft's agent-framework PyPI package compromised with credential stealer

      Socketpublished read socket.dev

    2. 2
      Two malicious Agent Framework releases hit PyPI in 33 minutes

      Aikido Securityread aikido.dev

    How this story was checked

    Automated source check, . Each claim below was compared with the source it cites before publication. Read our standards for what that check does and does not cover.

    • Versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI contained .pth startup hooks that ran a credential collector. Source 1
    • Aikido's timeline puts 1.26.1 on PyPI at 20:35 UTC on November 17, 1.26.2 33 minutes later, and both removed by 21:20 UTC. Source 2
    • The package gets about 190,000 downloads a month, and Aikido says the attacker used valid publishing credentials whose origin is unknown. Source 2
    • Version 1.26.2 restored the original __init__.py, so checking only that file misses it, and added GitHub Actions OIDC token requests. Source 1

    Tags: AI agents · Supply chain attack · Credential theft · DevSecOps

    From the publisher

    Sonomos publishes this newsroom and makes Locke, a desktop app that detects sensitive data on your device and masks it before a prompt reaches an AI service.

    How Locke works

    General information about privacy, security and AI, not legal advice. Laws and guidance change; check the dates above and the sources cited before relying on anything here.