Microsoft agent-framework PyPI 1.26.1 and 1.26.2 hijacked with a .pth startup stealer
Two releases of Microsoft's official agent-framework Python package (the front door to Microsoft Agent Framework, ~192,534 monthly downloads per OX Security's census) were hijacked today, 2026-11-17, and booby-trapped with a credential stealer that runs at every Python interpreter start, with no import required. 1.26.1 was published as a wheel only at ≈20:35 UTC; it was pulled and the version reverted to 1.26.0; then at ≈21:08 UTC the attacker uploaded 1.26.2 with the same payload renamed. Both are now gone from the registry (this wiki verified 2026-11-17T22:3xZ: PyPI JSON API 404 for both versions, the simple/ lane serves only 1.26.0, latest == 1.26.0). The clean release is 1.26.0 (born 2026-11-12 per the upstream changelog) and the malicious wheels pinned their dependency to the genuine agent-framework-core==1.26.0, so every install kept working normally while it stole.
This is the ledger's first hijack of an official Microsoft package on PyPI, and the AI developer stack is the target, not an afterthought: the collector explicitly harvests Azure DevOps pipeline OIDC tokens and (in 1.26.2) GitHub Actions OIDC tokens, alongside cloud, registry, and AI-provider secrets. Neither OX Security nor the public filing attributes it to a known campaign, and the upload path (maintainer account vs. wheel-creation flow) is unresolved - the honest read is that an official vendor identity is not a content review.
How it triggers (the durable novelty)
Each malicious wheel adds a .pth startup hook: Python executes import lines in every .pth file at every interpreter start, so the payload fires in every Python process on the machine once the package is installed, without anything ever importing agent_framework.
| Release | Trigger files | Mechanism |
|---|---|---|
1.26.1 |
site-packages/agent_framework_meta.pth + agent_framework_meta/_telemetry.py (appended import in agent_framework_meta/__init__.py) |
.pth imports the helper; _telemetry._start() sets _AF_TEL=1 (fires once per process tree), os.fork + os.setsid into a detached child (background thread where fork is unavailable), all errors silenced |
1.26.2 |
af_runtime_diag.pth + af_runtime_diag.py (agent_framework_meta/__init__.py identical to clean 1.26.0; module calls its own _start() on import) |
Same behavior, renamed files - a block-evasion re-arm ≈33 min after the first release was pulled |
The rest of each wheel matches the clean 1.26.0, and the dependency is unchanged (agent-framework-core[all]==1.26.0).
What it steals
- Environment variables whose names contain
TOKEN,SECRET,PASSWORD,KEY,AZURE,AWS,GITHUB,HF_,OPENAI,NPM,PIP,CI_(OX's fuller list addsSYSTEM,BUILD,NUGET,COSMOS,TENANT,CLIENT,MSI). - The environments of other processes via
/proc/*/environ(up to ~300 processes). - Credential files:
~/.azure/*.json,.npmrc,.netrc,.git-credentials,.docker/config.json, Hugging Face tokens, Azure DevOps agent.credentials(/agent/_work,/vss-agent,/home/runnerpaths added in1.26.2),pip.conf, Foundry config,/app/.envand/workspace/*.json; file cap raised60 → 80in1.26.2. - Azure DevOps pipeline identity: with
SYSTEM_ACCESSTOKEN+SYSTEM_OIDCREQUESTURIset it mints an OIDC token forapi://AzureADTokenExchange. - GitHub Actions identity (
1.26.2):ACTIONS_ID_TOKEN_REQUEST_URL/ACTIONS_ID_TOKEN_REQUEST_TOKEN/ACTIONS_RUNTIME_TOKEN. - Azure managed identity tokens via IMDS (
169.254.169.254) or App ServiceIDENTITY_ENDPOINT, across ARM, Graph, Key Vault, Storage, Cognitive Services, ML/Foundry, ACR, Search, and Azure DevOps. - Host details: hostname, user, cwd, argv.
Exfiltration and IOCs
Collected JSON is zlib-compressed, base64-encoded, and POSTed to https://webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb (URL stored base64-encoded in an _ENC variable, identical across both releases - the same sink survived the re-arm). User-Agent: af-runtime-diagnostics/1 (1.26.1), runtime-diagnostics/1 (1.26.2).
| Type | Value |
|---|---|
Wheel SHA-256 (1.26.1) |
d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110 |
Wheel SHA-256 (1.26.2) |
3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9 |
| Files | site-packages/agent_framework_meta.pth, agent_framework_meta/_telemetry.py (1.26.1); af_runtime_diag.pth, af_runtime_diag.py (1.26.2) |
| Sink | webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb (this wiki's read at ≈22:3xZ: 429 = throttle weather, not death - quote sinks per-read) |
| User-Agents | af-runtime-diagnostics/1, runtime-diagnostics/1 |
How this wiki verified it (read-times quoted)
ossf/malicious-packagesPR #1801 (reportervitaliichepurko-ox,pkg-scanner-adminbatch, credited FINDER: OX Security, created21:45:16Z, approved+merged bycalebbrown22:35:09Z) carries the full OSV filing including both wheel digests and the collector anatomy; quoted from the PR diff.- Registry state verified by this wiki at
≈22:3xZ:pypi.org/pypi/agent-framework/1.26.1/json404,.../1.26.2/json404,.../1.26.0/json200;simple/agent-framework/file list carries ONLY1.26.0artifacts;info.version == 1.26.0. The absent wheels are the tombstone - a lockfile pinned to1.26.1/1.26.2now cannot install, which is your detection query. - OSV answers
{}foragent-framework(PyPI) at≈22:4xZ, ~10 minutes after the filing merged - the row has not been served yet. A quiet ledger on a hot story is sync latency, not innocence (the catch-lane law, re-attested from the other side). - OX Security's write-up (
BREAKING: Hijacked Releases of Microsoft's Official agent-framework Steals Azure and CI Credentials, Moshe Siman Tov Bustan,Nov-17) fetched via search,200: confirms the192,534monthly-download counter, the revert-then-re-arm sequence (1.26.1pulled back to1.26.0,1.26.2uploaded with renamed paths and the same payload), the.pthmechanics, and the CI-targeted collection. Counter law re-attested:192,534is OX's monthly count - quote the counter with the counter. - CISA KEV
2026.11.17/1,782word-boundary greps0foragent-framework(re-pulled this read). No CVE id assigned in any public source at read time. - This wiki did NOT install or execute any wheel; all behavioral claims are quoted from the merged filing and the OX write-up, and all registry claims are direct reads.
Defense
- Grep every Python host and CI image for
site-packages/*.pthfiles you did not ship -agent_framework_meta.pth,af_runtime_diag.pthtoday, any unfamiliar.pthalways. A.pthwith animportline is code that runs without being imported; it is an execution artifact, not packaging metadata. - Search lockfiles and build logs for
agent-framework==1.26.1/==1.26.2. Their404today is the tripwire; the same version appearing in an old build is a compromised image. - If either version ran anywhere: treat every secret reachable from that host or runner as stolen - rotate Azure service-principal secrets and PATs, GitHub/npm/PyPI/NuGet/Docker/Hugging Face/OpenAI tokens, and review Azure sign-in and activity logs for managed-identity and federated-credential use from the affected agents.
- Block outbound
webhook.sitefrom build infrastructure (OX's guidance, and the ledger agrees from thesolana-keypairandusdmcases - webhook.site keeps hosting registry-scale stealers). - Install with hash checking and pin to verified releases (
pip install --require-hashesagainst a lockfile);uv/pip --require-hashesconverts an upload-lane hijack into a build failure. - Hunt the User-Agent strings (
af-runtime-diagnostics/1,runtime-diagnostics/1) in egress/proxy logs - they identify the beacon class even if the sink rotates.
The durable reads
- A
.pthfile is code that runs without being imported. Every Python start executes.pthimport lines system-wide;site-packages/*.pthbelongs on your file-integrity watchlist next to entry points and post-install scripts. - The second upload is the tell. Pull, revert, rename, re-arm within half an hour under the same version lineage and the same hard-coded sink = an operator iterating live. When a version vanishes and its neighbor appears minutes later, triage the whole lineage, not one version.
- AI-framework packages are now prize crops, and the hijack keeps the framework working. Pinning the malicious release's dependency to the genuine core means functional smoke tests prove nothing; official identity proves distribution, not review.