Microsoft agent-framework PyPI package trojanized: versions 1.26.1 and 1.26.2 carried a .pth credential stealer targeting Azure and CI/CD
Matéria consolidada. Reúne 9 matérias que o Tifon tinha publicado separadamente sobre a mesma história. A IA reescreveu o relatório com o que as 10 fontes trouxeram em 19/11/2026 12:04; os links antigos trazem para cá.
Fontes: helpnetsecurity.com ↗ elastic.co ↗ theregister.com ↗ bleepingcomputer.com ↗ securityweek.com ↗ securityonline.info ↗ thehackernews.com ↗ gbhackers.com ↗ safedep.io ↗ wiz.io ↗
On 17 November 2026, attackers published two malicious versions of Microsoft's agent-framework Python package (Microsoft Agent Framework) to PyPI: 1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC (wiz.io, elastic.co). Both carry a credential stealer aimed at Azure, Azure DevOps, GitHub Actions and other CI/CD secrets. A .pth startup hook runs it on every Python start, even if the package is never imported, so a plain pip install in a CI job is enough. Both versions were pulled at about 21:30 UTC, roughly 55 minutes of exposure (securityonline.info), and are now quarantined. The last clean release is 1.26.0. 1.26.2 was uploaded after 1.26.1 had already been quarantined or reverted, which shows the attacker kept publishing access (helpnetsecurity.com, theregister.com). OX Security and OpenSourceMalware say it went out through Microsoft's official PyPI publisher account (theregister.com). Microsoft acknowledged the incident, and a maintainer confirmed in a GitHub discussion that the releases were removed and an investigation is underway (securityweek.com). Microsoft told The Register it made some repositories private while investigating malicious content (theregister.com). The way the attacker gained publishing access is still unconfirmed; none of the reports explain it (helpnetsecurity.com). Multiple vendors (Aikido, Endor Labs, OX Security, SafeDep, Socket, StepSecurity, Wiz, Elastic) analyzed the malware (thehackernews.com, elastic.co).
Detalhes técnicos
- 1.26.1 drops
agent_framework_meta.pth, which importsagent_framework_meta. A hook in its__init__.pycalls_telemetry._start(), which forks and detaches with setsid on Unix (a daemon thread elsewhere, a background thread on Windows) and runs the collector, disguised as SDK telemetry. The_AF_TELenvironment flag limits it to one run per process tree and errors are suppressed (gbhackers.com, safedep.io, elastic.co). It added_telemetry.pyand modified__init__.py(elastic.co). It shipped as a single 10,402-byte wheel, whereas earlier releases had a wheel and an sdist (safedep.io). The legitimate framework components were kept, so applications kept working (securityweek.com). Both bad versions kept the dependency on the genuine agent-framework-core 1.26.0 (helpnetsecurity.com), and the malware pulls the genuine 1.26.0 so the package looks legitimate (theregister.com). - 1.26.2 is a repacked 1.26.1. It restores the clean
__init__.pyand moves execution toaf_runtime_diag.pthandaf_runtime_diag.py, which starts itself on import. It adds theft of GitHub Actions OIDC tokens in workflows withid-token: write, for the audiencesapi://AzureADTokenExchangeandhttps://management.azure.com/. It also widens environment-variable matching and adds runner directories. - Collected data: environment variables matching secret-like names (31 substrings, per safedep.io; names containing TOKEN, SECRET, AZURE, AWS or GITHUB, per helpnetsecurity.com),
/proc/<pid>/environof other processes (up to 300, per safedep.io, elastic.co, helpnetsecurity.com), and credential files. These include Azure CLI data and token caches, Azure DevOps agent credentials (Azure Pipelines agent .credentials files), .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face tokens and .env/JSON files, including .env files under /app and /workspace (elastic.co). - The stealer requests fresh tokens: Azure DevOps federated OIDC via SYSTEM_ACCESSTOKEN, and Azure managed-identity tokens (IMDS at 169.254.169.254, also via IDENTITY_ENDPOINT or MSI_ENDPOINT) for Resource Manager, Key Vault, Storage, Graph, Azure DevOps and others, 12 resources in total (wiz.io, elastic.co). It also collects IMDS metadata (elastic.co). The Azure DevOps requests omit serviceConnectionId, so it is unclear whether they return a usable token (elastic.co). StepSecurity notes there is no confirmation that any tokens were actually issued (helpnetsecurity.com).
- Exfiltration is a single HTTPS POST of zlib-compressed, base64-encoded JSON to a hardcoded webhook[.]site URL (path d381fd80-ec62-42ad-8f5c-d1b15103c9bb, with
?t=telemetryper gbhackers.com, elastic.co). This is the only indicator shared by both versions. User-Agent: af-runtime-diagnostics/1 in 1.26.1 and runtime-diagnostics/1 in 1.26.2 (safedep.io, wiz.io, elastic.co). Socket saw no further payload download in the collectors it analyzed (gbhackers.com). - The malware is not persistent: it runs only while the malicious package stays in site-packages (theregister.com).
- The attacker's webhook.site token was on the free tier, which caps captures at 100 requests. Wiz confirmed at most 50 requests were captured, and these can contain working credentials (wiz.io).
- Detection: Elastic's supply-chain monitor flagged 1.26.1 six minutes after publication (elastic.co). SafeDep flagged 1.26.1 22 minutes after publication and 1.26.2 four minutes after upload (safedep.io).
- Entry vector: Wiz found no matching tag or release in microsoft/agent-framework, which suggests the upload bypassed the normal release process (wiz.io, securityonline.info citing Socket). Suspected, unconfirmed vectors include an abused PyPI upload token, a misconfigured Trusted Publisher rule or a compromised maintainer account (securityonline.info). OX Security suggests a hijacked wheel-creation flow (thehackernews.com). The Register suggests unauthorized access to an administrator account in Microsoft's GitHub organization, since 1.26.2 went out through the official publisher account after 1.26.1 was reverted (theregister.com). SafeDep found a PyPI maintainer account named vibiret, created on the day of the attack, with publish rights on the package and five related projects; its role is unconfirmed (securityweek.com).
- Context: durabletask 1.4.1 to 1.4.3, another Microsoft package, was published with a stolen PyPI token in May 2026 (safedep.io, wiz.io). The May incident was attributed to TeamPCP and spread the Mini Shai-Hulud worm (thehackernews.com). No source links it to this incident. A similar .pth pattern appeared in LiteLLM 1.107.0 in October (safedep.io).
Remediação
- Search lockfiles, CI logs, virtualenvs, container images, pip/uv caches and internal mirrors for 1.26.1 and 1.26.2, and pin
agent-framework==1.26.0, ideally with --require-hashes until Microsoft confirms newer releases are clean. - Look in site-packages for
agent_framework_meta.pth,af_runtime_diag.pthand the matching module files, without starting the environment's Python. - Do not remove the package with pip. Uninstalling triggers the startup hook and runs the stealer again (securityonline.info, citing Wiz). Instead set
_AF_TEL=1(kill switch) and delete the startup files manually (securityonline.info). Isolate affected hosts and runners before running Python or pip again (helpnetsecurity.com). - Rebuild affected Docker containers and virtual environments. Isolate affected hosts and runners and restore from a clean environment.
- Treat all secrets reachable from affected hosts as exposed and rotate them from a clean system. This covers cloud credentials, repository tokens and CI/CD secrets. Removing the package does not invalidate stolen secrets.
- For 1.26.2 with
id-token: write, treat GitHub OIDC tokens as exposed. Stolen tokens are valid for up to 24 hours, and rotation does not revoke tokens already issued (wiz.io, safedep.io, helpnetsecurity.com). Review OIDC permissions, federated credentials and managed-identity role assignments (helpnetsecurity.com). - Audit Entra, Azure, Azure DevOps and GitHub Actions sign-in and activity logs, and managed identities and federated credentials, from 2026-11-17 20:35 UTC onward.
- Search proxy, DNS, firewall and egress logs for the webhook.site URL above and for the two User-Agents (elastic.co).
- Hardening: consider a delay before adopting newly published packages (elastic.co). Coder's Eric Paulsen advises an internal mirror of approved versions, ephemeral build environments, credentials that expire within the hour and an outbound allowlist (helpnetsecurity.com).
Relatos divergentes
- Download volume: about 41,000 per week (wiz.io, securityonline.info) versus about 192,000 per month (safedep.io), 192,534 per month per OX (helpnetsecurity.com), and about 190,000 to nearly 200,000 per month (thehackernews.com, securityweek.com, theregister.com). The figures are broadly similar but not identical. No source gives the number of installs of the malicious versions, and none is authoritative.
- Exposure window: the end is given as 21:30 UTC, when both versions were no longer available (wiz.io, securityonline.info), as about 9:20 p.m. UTC (thehackernews.com), and as removal within the hour (elastic.co). The start, 20:35 UTC, is consistent across sources.
- Credential-file cap: Wiz says 1.26.2 raised the file cap from 60 to 80 (wiz.io). SafeDep describes up to 60 credential files without mentioning a change (safedep.io).
- Microsoft's position: Wiz mentions no Microsoft statement (wiz.io, the earliest source). Later sources say Microsoft acknowledged the incident, that a maintainer confirmed the removal and investigation (securityweek.com), and that Microsoft made some repositories private during the investigation (theregister.com), which is the more recent information.
- Microsoft repositories: securityonline.info says Microsoft's GitHub repositories and the .NET edition were not affected. securityweek.com and theregister.com, the later sources, report the Agent Framework GitHub repository was offline or inaccessible, and that the ONNX Runtime repository and other Microsoft repositories had also disappeared. Microsoft attributes private repositories to its investigation (theregister.com). Any link between the ONNX Runtime repositories and this campaign is unclear; no one has established it.
- Entry vector: the cause is unconfirmed everywhere. Hypotheses differ: an abused token, Trusted Publisher misconfiguration or compromised maintainer account (securityonline.info), a hijacked wheel build (thehackernews.com), the vibiret maintainer account (securityweek.com), and an unauthorized administrator account in Microsoft's GitHub organization (theregister.com, a suggestion rather than a confirmed finding). helpnetsecurity.com says none of the reports explain how publishing rights were obtained.
- 1.26.1 status before 1.26.2: The Register, citing OX Security and OpenSourceMalware, says 1.26.1 was reverted before 1.26.2 was uploaded; helpnetsecurity.com says it was quarantined by PyPI first. Both agree the attacker could still publish.
- Token theft success: Wiz and Elastic describe the token requests the stealer makes, but StepSecurity says there is no confirmation any tokens were issued (helpnetsecurity.com), and Elastic notes the Azure DevOps requests may not return a usable token (elastic.co).
Linha do tempo
-
Microsoft agent-framework PyPI releases 1.26.1 and 1.26.2 trojanized with .pth credential stealer targeting cloud and CI/CD secrets
ler a análise desta fonte ocultar
On November 17, 2026, versions 1.26.1 and 1.26.2 of Microsoft's official agent-framework package on PyPI were published carrying a credential-stealing payload. StepSecurity, OX Security and Socket analyzed it. The payload is installed as a .pth startup hook, so it runs at Python startup without the framework being imported. PyPI quarantined both releases, but the attacker uploaded 1.26.2 after 1.26.1 was already quarantined, which shows continued publishing access. None of the reports explain how the attacker obtained publishing rights. This summary is based on the article alone; no vendor advisory or other primary source was consulted.
Technical Details
- OX reports 192,534 monthly downloads. Version 1.26.0 is the last clean release.
- Both bad versions kept the dependency on the genuine agent-framework-core 1.26.0, so the framework worked normally.
- Version 1.26.2 restored the original package initializer and moved the hook into a new file, af_runtime_diag.pth.
- The stealer collects environment variables whose names contain TOKEN, SECRET, AZURE, AWS or GITHUB. It reads the environments of up to 300 other processes. It copies .env files and credential files for Azure CLI, pip, npm, Git, Docker and Hugging Face.
- It attempts to request fresh Azure managed-identity and CI federation tokens. Version 1.26.2 added GitHub Actions OIDC tokens. StepSecurity notes there is no confirmation that any tokens were issued.
- The data is compressed, encoded and sent to a webhook.site endpoint in a single request.
Remediation
- Isolate affected hosts and runners before running Python or pip again, rebuild from a clean base and pin agent-framework to 1.26.0.
- Treat every secret reachable from the host as compromised.
- Rotating stored secrets does not cancel tokens already issued. Review OIDC permissions, federated credentials and managed-identity role assignments.
- Coder's Eric Paulsen advises an internal mirror of approved versions, ephemeral build environments, credentials that expire within the hour and an outbound allowlist.
-
Malicious agent-framework 1.26.1 and 1.26.2 on PyPI steal Azure, Azure DevOps and GitHub Actions tokens via .pth hook
ler a análise desta fonte ocultar
Microsoft's agent-framework meta-package on PyPI was compromised on November 17, 2026. Version 1.26.1 was published at 20:35 UTC and 1.26.2 at 21:08 UTC. Elastic's supply-chain monitor flagged 1.26.1 as malicious six minutes after publication, and PyPI removed both versions within the hour. Both versions carried a credential stealer that ran on every Python start through a .pth startup hook, so importing the package was not required. Any host that installed either version should be treated as fully compromised, and defenders should pin back to 1.26.0. This record is based only on the Elastic article; no web research was run, so the vendor advisory, a CVE or GHSA, the cause of the compromise and attribution were not checked. The article gives no CVE and names no threat actor.
Technical Details
- 1.26.1 added
agent_framework_meta.pthand_telemetry.pyand modified__init__.py. The .pth line importsagent_framework_meta, whose__init__.pyloader calls_telemetry._start(). _start()uses the_AF_TELenvironment variable to run once per process tree, then forks and detaches with setsid. On Windows it uses a background thread instead.- The stealer collects environment variables with secret-related names. It reads
/proc/<pid>/environfor up to 300 processes. It also reads Azure CLI token caches, pip.conf, .npmrc, .netrc, .git-credentials, .env files under /app and /workspace, and Azure Pipelines agent .credentials files. - In Azure DevOps it uses SYSTEM_ACCESSTOKEN against SYSTEM_OIDCREQUESTURI. The requests omit serviceConnectionId, so it is unclear whether they return a usable token.
- It requests managed identity tokens for 12 resources through IDENTITY_ENDPOINT, MSI_ENDPOINT or IMDS (169.254.169[.]254), and it collects IMDS metadata.
- 1.26.2 uses
af_runtime_diag.pthandaf_runtime_diag.py. It has the same stealer code plus a GitHub Actions OIDC collector, which requests tokens for the audiences api://AzureADTokenExchange and https://management.azure[.]com/. - Data is JSON-serialized, zlib-compressed, Base64-encoded and POSTed to
https://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry. The User-Agents are af-runtime-diagnostics/1 and runtime-diagnostics/1.
Remediation
- Search site-packages for
agent_framework_meta.pthandaf_runtime_diag.pth. - Pin agent-framework to 1.26.0.
- Treat all secrets readable on affected hosts as compromised. Rotate long-lived secrets and review activity for short-lived tokens that cannot be revoked.
- Search proxy, DNS and firewall logs for webhook[.]site and the two User-Agents.
- Consider a delay before adopting newly published packages.
- 1.26.1 added
-
Microsoft agent-framework PyPI package versions 1.26.1 and 1.26.2 hijacked to deliver info-stealing malware
ler a análise desta fonte ocultar
Microsoft's official agent-framework package on PyPI was hijacked, and versions 1.26.1 and 1.26.2 install an info-stealer. Researchers at OX Security and OpenSourceMalware reported that 1.26.1 was reverted, but the attacker then uploaded 1.26.2 through Microsoft's official PyPI publisher account. The article suggests unauthorized access to an administrator account on Microsoft's GitHub organization. Microsoft told The Register it made some repositories private while investigating malicious content. This research did not include web searches, so the article is the only source: no vendor advisory, CVE or fix was checked.
Technical Details
- The malware runs when the Python interpreter starts with the package installed, so the package never has to be imported.
- It pulls the genuine 1.26.0 release so the package keeps working and looks legitimate.
- It collects environment variables and credential files for Azure, Git, Docker, Hugging Face and other developer services.
- It encodes the stolen data as base64 JSON and sends it to a hard-coded webhook.site address.
- It also requests fresh identity tokens from GitHub Actions, Azure DevOps and Azure and exfiltrates them to the same address. This makes cloud build environments especially exposed.
- It is not persistent and runs only while the malicious package stays in site-packages.
- The package has nearly 200,000 downloads a month.
- The agent-framework GitHub repo is offline. The ONNX Runtime repo is also offline, but no one has linked it to this campaign.
Remediation
- Treat any environment with 1.26.1 or 1.26.2 as compromised.
- Rotate all secrets and tokens that were reachable from it.
- Review CI/CD and cloud accounts for misuse.
-
Microsoft Agent Framework PyPI Package Trojanized in Supply Chain Attack to Steal Cloud and CI/CD Credentials
ler a análise desta fonte ocultar
On November 17, attackers published two malicious versions (1.26.1 and 1.26.2) of the agent-framework Python package, the Microsoft Agent Framework, on PyPI. The package has about 190,000 downloads per month. The versions were released roughly 33 minutes apart. Both are now quarantined, and 1.26.0 is the latest clean release. Microsoft acknowledged the incident, and a maintainer confirmed in a GitHub discussion that the releases were removed and an investigation is underway. The publishing method is unknown. This summary comes from the article alone, as no web research was performed.
Technical Details
- The malicious builds kept the legitimate framework components, so applications kept working normally.
- The malware abuses a Python startup mechanism and runs whenever the interpreter starts, even if the package is never imported.
- It targets secrets in environment variables and configuration files, and credentials of other running processes. It also tries to obtain Azure managed identity tokens and Azure DevOps tokens.
- The second release extended credential theft to GitHub Actions.
- Only built distributions were published, unlike legitimate releases, which also had source distributions. Wiz found no matching releases or malicious code in Microsoft's main repository, which suggests an upload outside the normal release process.
- SafeDep found a PyPI maintainer account named vibiret, created on the day of the attack, with publish rights on the package and five related projects. Its role in the malicious uploads is unconfirmed.
- OX Security, Wiz, Endor Labs and SafeDep analyzed the malware independently.
- The Agent Framework GitHub repository was inaccessible when the article was written. Several other Microsoft repositories, including ONNX Runtime projects, had also disappeared. Any link between these events is unclear.
Remediation
- Check developer environments, CI/CD pipelines and container images for versions 1.26.1 and 1.26.2, and replace them with verified packages.
- Rotate potentially exposed credentials, investigate suspicious cloud activity, and rebuild affected environments.
-
Malicious Microsoft Agent Framework 1.26.1 and 1.26.2 published to PyPI with credential stealer; removed within an hour
ler a análise desta fonte ocultar
Threat actors published malicious versions 1.26.1 and 1.26.2 of Microsoft's Agent Framework to PyPI on 17 November 2026 (20:35 and 21:08 UTC). The releases bundled a credential stealer that targets cloud keys, local environment secrets and GitHub Actions tokens. Both versions were pulled at about 21:30 UTC, roughly 55 minutes of exposure. Microsoft is still investigating the entry vector. Only PyPI distributions were affected; Microsoft's GitHub repositories and the .NET edition were not. This summary is based on the article alone; no web research was performed, so no vendor advisory, CVE or CVSS data is confirmed.
Technical Details
- Neither version had matching GitHub tags, release notes or release manifests, which suggests the standard release automation was bypassed (securityonline.info, citing Socket).
- The suspected vector is an abused PyPI upload token, a misconfigured Trusted Publisher rule or a compromised maintainer account. This is not confirmed.
- The package averages about 41,000 weekly downloads. No exact download count for the exposure window has been disclosed.
- Wiz warned that running pip to remove the package triggers startup execution of files embedded in the malicious release, which runs the stealer again.
Remediation
- Set
_AF_TEL=1(the kill switch) and manually delete the malicious startup files. Do not use pip to uninstall. - Pin
agent-framework==1.26.0. - Purge 1.26.1 and 1.26.2 from pip caches, uv caches, CI runners and internal mirrors.
- Rebuild Docker containers and Python virtual environments that pulled the bad releases.
- Rotate all cloud credentials, repository tokens and CI/CD secrets on affected hosts.
- Audit Entra, Azure, Azure DevOps and GitHub Actions logs for activity after 2026-11-17 20:35 UTC.
-
Microsoft agent-framework PyPI package compromised (v1.26.1, 1.26.2) to steal Azure and CI/CD credentials via .pth hooks
The article adds multi-vendor confirmation (Aikido, Endor Labs, OX Security, SafeDep, Socket, StepSecurity, Wiz), the full webhook.site URL path, the quarantine of both versions on PyPI, about 190,000 monthly downloads, the exposure window (8:35 to about 9:20 p.m. UTC), the safe version 1.26.0, a possible wheel-build hijack, and the earlier durabletask incident.
ler a análise desta fonte ocultar
The article adds multi-vendor confirmation (Aikido, Endor Labs, OX Security, SafeDep, Socket, StepSecurity, Wiz), the full webhook.site URL path, the quarantine of both versions on PyPI, about 190,000 monthly downloads, the exposure window (8:35 to about 9:20 p.m. UTC), the safe version 1.26.0, a possible wheel-build hijack, and the earlier durabletask incident.
Threat actors compromised Microsoft's agent-framework package on PyPI and published malicious versions 1.26.1 and 1.26.2 33 minutes apart on November 17, 2026. Both install a
.pthfile that runs a credential stealer on every Python start. The article credits reports from Aikido, Endor Labs, OX Security, SafeDep, Socket, StepSecurity and Wiz. Both versions have been quarantined on PyPI. It is unclear how the attacker obtained publishing access. The package gets about 190,000 downloads a month. This summary rests on the article alone, and no vendor advisory was checked.Technical Details
- v1.26.1 drops
agent_framework_meta.pth. v1.26.2 dropsaf_runtime_diag.pthand adds the moduleaf_runtime_diag.py, which also collects GitHub Actions OIDC tokens and uses broader environment-variable patterns. - Targets: environment variables, Azure CLI files, .npmrc, pip.conf, .netrc, .git-credentials, .docker/config.json, Hugging Face and Azure DevOps agent credentials, and .env and JSON files. It also targets Azure managed-identity tokens and IMDS data (169.254.169.254), and in Azure DevOps it requests federated tokens.
- Exfiltration: JSON, zlib-compressed, Base64-encoded, sent by HTTPS POST to webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb.
- OX Security suggests the attackers hijacked the wheel-creation flow to inject the malicious logic.
- The article notes the earlier May 2026 TeamPCP compromise of the durabletask package, which spread the Mini Shai-Hulud worm.
Remediation
- Isolate affected hosts and runners. Pin to 1.26.0 and restore from a clean environment.
- Check for exposure between about 8:35 and 9:20 p.m. UTC on November 17, 2026.
- Search proxy and DNS logs for the webhook.site URL.
- Rotate exposed credentials from a clean system. Audit Azure identities, sign-in logs and GitHub Actions workflows that deploy to Azure.
- v1.26.1 drops
-
Microsoft agent-framework PyPI package trojanized (v1.26.1, 1.26.2) with .pth credential stealer targeting Azure and CI/CD
ler a análise desta fonte ocultar
Per the article, Microsoft's agent-framework Python package was compromised on PyPI on November 17, 2026. Malicious versions 1.26.1 and 1.26.2 shipped a credential stealer aimed at cloud identities, developer secrets and CI/CD environments. The analysis is credited to the Socket Research Team. This summary rests on the article alone; no vendor advisory or other source was checked.
Technical Details
- Both releases use Python startup hooks (.pth files with executable import lines), so the code runs whenever Python starts, even without importing agent-framework.
- v1.26.1 installs
agent_framework_meta.pth, which importsagent_framework_meta. Its modified initializer calls_telemetry._start(). On Unix the payload forks and detaches; elsewhere it uses a daemon thread. The_AF_TELenvironment flag limits repeat runs, and errors are suppressed. - v1.26.2 moves execution to
af_runtime_diag.pthandaf_runtime_diag.py. It restores the original initializer byte-for-byte, and it adds GitHub Actions identity endpoints, runner directories and more environment-variable patterns. - Targets: environment variables, /proc/*/environ, Azure CLI data, Azure DevOps agent credentials, npm and pip configuration, Git credentials, Docker auth, Hugging Face tokens and .env files. The malware also requests Azure managed-identity and federation tokens. v1.26.2 additionally requests GitHub Actions OIDC tokens for Azure audiences.
- Exfiltration: JSON, zlib-compressed and Base64-encoded, sent by HTTPS POST to a webhook.site URL with
?t=telemetry. Socket reported no further payload download in the collectors it analyzed.
Remediation
- Avoid both versions and remove affected installations.
- Rotate potentially exposed credentials, including cloud tokens and CI/CD secrets.
- Investigate developer machines and automation runners.
- Inspect both hook variants and search outbound traffic for the webhook.site endpoint.
- Removing the package does not invalidate secrets already stolen.
-
Microsoft agent-framework PyPI package trojanized twice (1.26.1, 1.26.2) with .pth credential stealer
ler a análise desta fonte ocultar
Two releases of agent-framework, Microsoft's Python metapackage for its Agent Framework, were published on PyPI on 17 November 2026 with a credential stealer. Nothing has to import the package. A .pth file runs the stealer at every Python start, so a
pip installin a CI job is enough. SafeDep flagged 1.26.1 22 minutes after publication. After 1.26.1 was removed, 1.26.2 shipped the same stealer under new file names, and SafeDep flagged it 4 minutes after upload. The last clean release is 1.26.0. The package gets about 192,000 downloads a month, the number of installs of the bad versions is unknown, and the way the attacker got publishing access is unknown. This article is the only source used; no Microsoft advisory was checked.Technical Details
- 1.26.1 ships
agent_framework_meta.pth, which importsagent_framework_meta. A hook appended to its__init__.pycalls_telemetry._start(), which forks, detaches with setsid and runs the collector. The release is a single wheel of 10,402 bytes, where earlier releases shipped a wheel and an sdist. - 1.26.2 restores the clean
__init__.py, moves the stealer into a new top-level module (af_runtime_diag) that starts itself on import, and adds GitHub Actions OIDC token theft for the audiencesapi://AzureADTokenExchangeandhttps://management.azure.com/. - The collector takes environment variables matching 31 substrings, up to 60 credential files (Azure CLI, pip.conf, .npmrc, .netrc, .git-credentials, Docker config, Hugging Face token, Azure DevOps agent credentials, .env files), and up to 300
/proc/<pid>/environfiles. - It requests fresh tokens: Azure DevOps federated OIDC via SYSTEM_ACCESSTOKEN, and Azure managed identity tokens for Resource Manager, Key Vault, Storage, Graph, Azure DevOps and others.
- Exfiltration goes by POST of zlib-compressed, base64-encoded JSON to hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. This is the only indicator both versions share. The User-Agent is af-runtime-diagnostics/1 in 1.26.1 and runtime-diagnostics/1 in 1.26.2.
- In May, durabletask 1.4.1 to 1.4.3, another Microsoft package, was published with a stolen API token. The article finds no evidence that the two incidents are linked. A similar .pth pattern appeared in LiteLLM 1.107.0 in October.
Remediation
- Search lockfiles for agent-framework 1.26.1 and 1.26.2. Look for
agent_framework_meta.pthandaf_runtime_diag.pthwithout starting the environment's Python. - Treat every secret reachable from an environment that installed either version as exposed. Rotation does not revoke tokens that were already issued.
- Review sign-in and activity logs of managed identities and federated credentials from the install time onward. Check egress logs for POSTs to the webhook.site URL.
- Pin agent-framework==1.26.0 with --require-hashes until Microsoft confirms that newer releases are clean.
- 1.26.1 ships
-
Malicious Microsoft agent-framework 1.26.1 and 1.26.2 published to PyPI with .pth credential stealer targeting Azure and CI
ler a análise desta fonte ocultar
On November 17, 2026, malicious versions 1.26.1 (20:35 UTC) and 1.26.2 (21:08 UTC) of the agent-framework package (Microsoft Agent Framework) were uploaded to PyPI. Both were no longer available as of 21:30 UTC. The package gets about 41,000 downloads a week, and the last safe version is 1.26.0. The payload is a credential stealer aimed at Azure, Azure DevOps and CI pipelines. It runs on every Python start through a .pth file, even if the package is never imported. The root cause is unconfirmed. Wiz found no matching tag or release in microsoft/agent-framework, which suggests the upload bypassed the normal release process. The article does not mention any Microsoft statement.
Technical Details
- 1.26.1 drops
agent_framework_meta.pth, which importsagent_framework_meta. That module calls_telemetry._start(), which forks into a detached session. The code is disguised as SDK telemetry. - 1.26.2 is a repacked 1.26.1. It uses
af_runtime_diag.pthandaf_runtime_diag.py, and the User-Agent isruntime-diagnostics/1. It adds theft of GitHub Actions OIDC tokens in workflows withid-token: write. It also widens environment-variable matching and raises the file cap from 60 to 80. - Collected data: environment variables matching secret-like names,
/proc/*/environof other processes, and credential files. The files include Azure CLI data, .npmrc, pip.conf, .netrc, .git-credentials, Docker config and Hugging Face tokens. Azure DevOps OIDC tokens and managed-identity tokens for 12 resources are also taken. - Exfiltration is a single zlib-compressed, base64-encoded HTTPS POST to a hardcoded webhook[.]site URL.
- The attacker's webhook.site token was on the free tier, which caps captures at 100 requests. Wiz confirmed at most 50 requests were captured, and those can contain working credentials.
- Wiz notes that durabletask, another Microsoft package, was compromised earlier this year through a stolen PyPI token. It has not linked the two incidents.
Remediation
- Search lockfiles, CI logs, virtualenvs and images for 1.26.1 or 1.26.2, and pin to 1.26.0.
- Look in site-packages for the .pth and module files listed above.
- Search proxy and DNS logs for webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb.
- Rotate all secrets on affected hosts and runners.
- Audit managed identities and federated credentials. Stolen tokens are valid for up to 24 hours.
- For 1.26.2 with
id-token: write, treat the GitHub OIDC tokens as exposed.
- 1.26.1 drops