Notes on the agent-framework PyPI compromise: a .pth hook, an hour on PyPI, and what a valid credential doesn't tell you

2026-11-21来源 dev.toEnglish

On 17 November 2026, two unauthorised releases of agent-framework, the PyPI package for Microsoft Agent Framework (an open-source SDK for building AI agents), shipped a credential stealer. At VSO we check incidents against primary sources before writing about them. A monitoring brief we received called this one "unreported"; it had been public since the day it happened. Here is what the sources establish, and what we take from it as people who build evidence tooling.

Facts, with sources

  • Versions and window. 1.26.1 at about 20:35 UTC and 1.26.2 at about 21:08 UTC on 17 November; both unavailable on PyPI by about 21:30 UTC (Wiz). Only the agent-framework meta-package was affected. 1.26.0 is clean (PYSEC-2026-4388, GHSA-764m-3ppc-5m73).
  • Trigger. Both were rebuilt from the 1.26.0 wheel plus a .pth file (agent_framework_meta.pth in 1.26.1, af_runtime_diag.pth in 1.26.2). Python processes .pth files at interpreter start, so the payload ran on every start in an affected environment, with no import.
  • Collection. Credential-like environment variables; secret-looking values from other processes' environments; credential files (Azure CLI, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face tokens, Azure DevOps agent credentials, .env and JSON under common app directories); Azure DevOps OIDC tokens; Azure managed-identity tokens; instance metadata. 1.26.2 also requested GitHub Actions OIDC tokens where the workflow had id-token: write.
  • Exfiltration. One HTTPS POST of compressed, encoded JSON to a fixed webhook.site URL. No fallback.
  • Impact sample. Wiz analysed the 50 requests stored at that endpoint (the free tier keeps at most 100): 4 from the attacker, 29 from sandboxes, scanners and tests, 17 representing 3 unique successful exfiltrations of victim data. That is a sample, not a victim count. Nobody has published installation counts for the two versions.
  • Root cause (assessment). Wiz assesses the attacker appears to have compromised a client certificate and private key for Microsoft's ESRP release pipeline; an attempt from AWS was rejected by IP filtering and one from Microsoft-owned address space succeeded. How the credentials were obtained is unknown. Microsoft has not published a root cause; a maintainer confirmed in issue #10411 that the versions were pulled and an investigation was under way.
  • Tooling. The attacker's tool identified itself as Cairn, an open-source AI pentest framework. Wiz draws no conclusion about autonomy and does not link this to earlier Cairn incidents.

What the brief got wrong

"Unreported" (Wiz and PyPA published on 17 November). "50 communications stored at the attack target" (they sat at the attacker's own drop point, and most weren't victim data). A credential list that was both incomplete and partly misattributed. And it applied our finance profile, VCP, to a case with no trading system in it.

Engineering notes

These are our notes, not claims from the incident reports.

1. A valid credential is identity, not authorisation. If Wiz is right, the release went through with the publisher's own credential. Signatures and upload tokens tell you which key acted. Record the authorisation decision separately, and record when a key's trust ended, including the uncertainty about when compromise actually began.

2. Provenance only helps if the legitimate history has it. SafeDep points out that 1.26.0 had no PyPI attestation either, so missing provenance didn't single out the bad wheels. If you publish packages, attest every release so that an unattested one stands out. If you consume them, decide what you'll do with an unattested release of a package that normally has attestations.

3. Treat .pth files as executable code. They run before your application. In an affected environment, any Python process, including pip, can re-run the hook. Remove the hook files or rebuild before using Python tooling there.

4. Keep your own record of egress. The only published evidence of successful exfiltration is a sample held by a free service the attacker chose. Proxy or DNS logs on your side are what let you answer "did our build send it?" Wiz suggests a 200 response means the data was accepted.

5. Rotate what was reachable, not what you think was present. The payload read other processes' environments and many credential files. Short-lived tokens (Wiz notes up to 24 hours) still need sign-in review; federated credentials in Entra ID need auditing.

Where our own framework stands

We develop VAP, an open specification for making AI decision records verifiable after the fact. This incident involves no AI decision, and supply-chain provenance (Trusted Publishing, attestations, SLSA, Sigstore) is the right toolbox, not VAP.

Note 1 does bear on VAP. v1.2 claims the attributability of records, and attributability rests on keys. The current text doesn't define how a verifier handles a key-compromise declaration, or what "attributable" means beyond verification under a supplied key. Both are candidate rows on our CHANGE-002 preparation register, an administrative discussion draft. Nothing there is adopted.

What VAP would not have done

  • Stopped any of this. VAP is post-hoc only and does not intervene while a system runs.
  • Vetted the package, kept the hook from running, or blocked or detected the outbound request.
  • Detected a stolen release credential, revoked a token or identified the attacker.
  • Recovered credential reads no system recorded. Never-measured events are outside its reach by construction.
  • Decided whether anyone met a legal duty or whether any decision was right. In the specification's normative wording, conformance to VAP or any profile:

"does not warrant the correctness, fairness, or safety of the underlying AI decisions — only the integrity, completeness (at anchor granularity), and attributability of their records." (VAP v1.2 §1.6(c))

VAP generates evidence; competent authorities and courts evaluate it.

Disclosures

Stage. Disclosure reviewed 11 November 2026; latest published count dated 25 October 2026: zero external implementations of VAP or any VAP profile, and zero Evidence Packs accepted in any proceeding. On 24 October 2026 we withdrew a previously published paid-service contract figure that had not been reconciled with primary records; that does not establish a count of zero, and no contract, customer or revenue figure is asserted here.

Standing. VAP has not been adopted by, and carries no standing within, the IETF, ISO/IEC JTC 1/SC 42, ITU-T or any other established standards body. VAP v1.2.0 is a Draft Specification (Draft 3).

Method and interest. First-party VSO verification done with AI assistance and no outside reviewer. Drafted with Claude, made by Anthropic, which is not a party to this incident. The author is Representative Director of VeritasChain Co., Ltd., which provides the operating base of VSO, and has an interest in the argument made here.

Sources

原文:https://www.a8q9.cn/en/article/notes-on-the-agent-framework-pypi-compromise-a-pth-hook-an-hour-on-pypi-and-what-497d6f.html

相关文章