Skip to navigation

Threat reportSupply ChainTL-2026-7173

Malicious agent-framework PyPI releases 1.26.1 and 1.26.2 (Microsoft Agent Framework meta-package) deliver credential stealer via .pth startup hook

highACTIVE

Two malicious versions (1.26.1 and 1.26.2) of the agent-framework PyPI package were published on 2026-11-17, 33 minutes apart. A .pth startup hook runs a stealer on every Python interpreter start that harvests environment secrets, credential files and Azure/GitHub Actions/Azure DevOps OIDC and managed-identity tokens, and exfiltrates them to a webhook.site endpoint.

By

Key facts

IdentifiersTL-2026-7173
Also known asagent-framework PyPI compromise, Microsoft Agent Framework PyPI compromise
SeverityHIGH
Affected productsMicrosoft agent-framework (Microsoft Agent Framework meta-package, PyPI)
Weaknesses (CWE)CWE-506
MalwarePython
MITRE ATT&CK techniquesT1005 Data from Local System, T1027 Obfuscated Files or Information, T1036.005 Match Legitimate Resource Name or Location, T1059.006 Python, T1078 Valid Accounts, T1082 System Information Discovery, T1119 Automated Collection, T1132.001 Standard Encoding, T1195.002 Compromise Software Supply Chain, T1528 Steal Application Access Token, T1546 Event Triggered Execution, T1552.001 Credentials In Files and 3 more in the attack flow
MotivationUNKNOWN
Target sectorstechnology, software development, cloud services, development
Target regionsGlobal
Detection rules9 (1 shown free)
Sources9 cited sources

Detection coverage

As of 2026-12-01, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-7173 across Splunk SPL, Microsoft KQL and Sigma, covering 20 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: agent-framework PyPI Compromise - Malicious .pth Startup Hook Written to site-packages

TL-2026-7173: detects creation of a .pth file inside a Python site-packages/dist-packages directory. Known-IOC branch matches agent_framework_meta.pth (agent-framework 1.26.1) and af_runtime_diag.pth (1.26.2), the hooks whose 'import' line makes Python's site module run the credential stealer on every interpreter start, even if the package is never imported. A second branch flags .pth files seen on 2 or fewer hosts as a behavioural hunting signal for look-alike hooks. The known-IOC branch is high fidelity; the rare-name branch needs tuning.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1195.002, T1546, T1059.006, T1036.005
  • Data sources: sysmon, sysmon_file_create_eventcode_11, defender_for_endpoint_DeviceFileEvents
  • Severity: high
  • Confidence: high

Splunk SPL

index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11 earliest=-24h (TargetFilename="*site-packages*" OR TargetFilename="*dist-packages*") TargetFilename="*.pth"
| eval pth_rel=lower(replace(TargetFilename,"^.*(site|dist)-packages",""))
| stats count min(_time) as firstTime max(_time) as lastTime dc(host) as host_count values(host) as hosts values(Image) as writer_process values(TargetFilename) as pth_path by pth_rel
| eval known_ioc=if(match(pth_rel,"(agent_framework_meta|af_runtime_diag)[.]pth$"),1,0)
| where known_ioc=1 OR (host_count<=2 AND NOT match(pth_rel,"(distutils-precedence|_virtualenv|easy-install|pywin32|nspkg|matplotlib|ruamel|google)"))
| eval signal=if(known_ioc=1,"TL-2026-7173 known malicious startup hook","rare .pth startup hook (hunt)")
| convert ctime(firstTime) ctime(lastTime)
| table signal pth_rel hosts writer_process pth_path count firstTime lastTime

Microsoft KQL

let KnownHooks = dynamic(["agent_framework_meta.pth","af_runtime_diag.pth"]);
let RarePth = toscalar(
    DeviceFileEvents
    | where Timestamp > ago(7d)
    | where FileName endswith ".pth" and FolderPath has_any ("site-packages","dist-packages")
    | summarize Devices=dcount(DeviceId) by FileName
    | where Devices <= 2
    | summarize make_set(FileName));
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated","FileModified","FileRenamed")
| where FileName endswith ".pth" and FolderPath has_any ("site-packages","dist-packages")
| extend KnownIoc = FileName in~ (KnownHooks)
| where KnownIoc or (set_has_element(RarePth, FileName) and not(FileName has_any ("distutils-precedence","_virtualenv","easy-install","pywin32","nspkg","matplotlib","ruamel","google")))
| project Timestamp, DeviceName, ActionType, FolderPath, FileName, SHA256, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, InitiatingProcessAccountName, KnownIoc

Sigma

title: Malicious agent-framework .pth Startup Hook Created in Python Site-Packages
id: 7c1e9a52-3b4d-4f86-9a17-5d2e8b0c4a11
status: experimental
description: Detects creation of agent_framework_meta.pth (agent-framework 1.26.1) or af_runtime_diag.pth (1.26.2). These .pth files contain an import line that Python's site module executes at every interpreter start, launching a credential stealer. TL-2026-7173.
references:
    - https://www.elastic.co/security-labs/threat-command/we-caught-the-agent-framework-pypi-compromise-six-minutes-after-it-published
    - https://www.stepsecurity.io/blog/microsoft-agent-framework-pypi-package-compromised
    - https://aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes
author: Threadlinqs Team
date: 2026-12-01
tags:
    - attack.persistence
    - attack.t1546
    - attack.initial-access
    - attack.t1195.002
    - attack.execution
    - attack.t1059.006
    - attack.defense-evasion
    - attack.t1036.005
logsource:
    category: file_event
detection:
    selection:
        TargetFilename|endswith:
            - 'agent_framework_meta.pth'
            - 'af_runtime_diag.pth'
    condition: selection
falsepositives:
    - Unlikely. These file names are specific to the malicious agent-framework 1.26.1 and 1.26.2 releases.
level: high

Known false positives:

  • Legitimate Python packages that ship their own .pth file (namespace packages, editable installs, pywin32) will appear in the rare-name branch on first install; the known-IOC branch is not affected.
  • Developers building or testing custom .pth hooks in a virtual environment.

Tuning notes: Alert on known_ioc=1 immediately and treat the host as compromised (rotate secrets readable by the Python user). For the rare-name branch, extend the allowlist regex with .pth names common in your fleet, or raise the host_count threshold on large estates. Sysmon must log EventCode 11 for site-packages paths; on Linux use Sysmon for Linux or an EDR file-create feed and adjust index/sourcetype. Virtualenv and container image build hosts are the usual noise sources.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account)
  • agent-framework Malicious Versions 1.26.1 / 1.26.2 Installed via Package Manager Command Line · unlock with TL Creds
  • agent-framework Stealer - Python Requesting Azure IMDS or GitHub Actions OIDC Tokens · unlock with TL Creds
  • agent-framework Stealer Exfiltration - Python Process Connecting to [indicator] · unlock with TL Creds
  • agent-framework Malicious Wheel Downloaded Through Web Proxy or Package Mirror · unlock with TL Creds
  • agent-framework Stealer Module Files Dropped ([indicator] and [indicator]) · unlock with TL Creds
  • agent-framework Stealer Exfiltration - DNS Resolution of [indicator] · unlock with TL Creds
  • agent-framework Stealer - Python Process Reading Multiple Credential Files (Linux auditd) · unlock with TL Creds
  • agent-framework Stealer Exfiltration - POST to [indicator] Endpoint or Known User-Agents (Web Proxy) · unlock with TL Creds

Indicators of compromise

As of 2026-12-01, Threadlinqs Intelligence tracks 20 indicators of compromise for TL-2026-7173.

Sample indicators (3 of 20)

  • Domain: webhook[.]site
  • File hash: d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110
  • File hash: 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9

Defanged, TLP:CLEAR. Full set of 20 indicators: unlock with TL Creds.

20 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

Elastic's supply-chain monitor flagged 1.26.1 about six minutes after publication and PyPI quarantined both versions within the hour.

On 2026-11-17 at 20:35 UTC a malicious wheel for agent-framework 1.26.1 (the Microsoft Agent Framework meta-package on PyPI) was uploaded, followed at 21:08 UTC by 1.26.2. The last clean release is 1.26.0 (published 2026-11-12). The package has roughly 196,000 downloads per month across all versions (Elastic). Both malicious releases kept a dependency on the legitimate agent-framework-core 1.26.0, so applications kept working while the malware ran.

Initial access / publishing vector: not established by any source. Aikido states the attacker held valid PyPI publishing credentials, and the method of obtaining them is unknown. StepSecurity reports the uploads were wheel-only with no provenance attestations (1.26.0 had a wheel and sdist), carried an uploader user-agent of RestSharp/106.13.0.0, and that a maintainer account named vibiret was created and added to the project the same day. Aikido's analysis indicates 1.26.1 appears to be a legitimate wheel unpacked, hand-edited and re-uploaded (stale WHEEL timestamp, world-writable injected files). The second upload occurred 2 min 23 s after the first was quarantined, showing publishing access persisted. Microsoft had not commented at the time of BleepingComputer's report; the main branch and release tag were reported not to contain malicious code (secondary report).

Execution: version 1.26.1 added agent_framework_meta.pth (single line 'import agent_framework_meta') and agent_framework_meta/_telemetry.py, and appended a loader to agent_framework_meta/__init__.py that imports _telemetry and calls _start() inside try/except. Python's site module executes import lines in .pth files at every interpreter startup, so the payload runs even if the package is never imported. Version 1.26.2 renamed the components to af_runtime_diag.pth / af_runtime_diag.py (restoring the original __init__.py) and added a GitHub Actions OIDC collector. _start() uses the _AF_TEL environment variable as a run-once guard; on POSIX it forks and calls setsid() so the child runs detached, on Windows it uses a daemon thread.

Collection: the stealer reads /proc/<pid>/environ of up to 300 processes and keeps variables whose names match secret-like substrings (TOKEN, SECRET, PASSWORD, KEY, CONNECTION, AZURE, AWS, GITHUB, GH_, HF_, OPENAI, FOUNDRY, PIP, NPM, CLIENT, IDENTITY, MSI and others), specifically targeting SYSTEM_ACCESSTOKEN and IDENTITY_HEADER. It reads up to 60 (1.26.1) or 80 (1.26.2) credential files under 256 KB from all home directories and /root: ~/.azure token caches, pip.conf, .npmrc, .netrc, .git-credentials, Docker config.json, Hugging Face tokens, Foundry configuration, .env files under /app and /workspace, Azure Pipelines agent .credentials files and (1.26.2) GitHub runner directories. It attempts to mint Azure DevOps OIDC tokens (SYSTEM_ACCESSTOKEN POST to SYSTEM_OIDCREQUESTURI, api-version=7.1), Azure managed identity tokens for 12 resources (ARM, Microsoft Graph, Key Vault, Storage, Azure AI Foundry, Azure ML, Container Registry, Azure DevOps 499b84ac-1321-427f-aa17-267ca6975798) via IDENTITY_ENDPOINT/MSI_ENDPOINT or IMDS at 169.254.169.254, and (1.26.2 only) GitHub Actions OIDC tokens for audiences api://AzureADTokenExchange and https://management.azure.com/. Whether tokens were successfully issued is unconfirmed (static analysis only).

Exfiltration: data (plus hostname, username, working directory, command line, timestamp) is JSON-serialized, zlib-compressed (level 9), base64-encoded and sent as one POST (Content-Type application/octet-stream) to https://webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry, with User-Agent af-runtime-diagnostics/1 (1.26.1) or runtime-diagnostics/1 (1.26.2). The endpoint is stored base64-encoded in the code (_ENC). No second stage and no retry logic were found. webhook.site is a legitimate public service, so a connection alone does not prove exfiltration.

Attribution: no source names a threat actor. Severity HIGH and the FINANCIAL/UNKNOWN motivation question are analyst judgements; motivation is recorded as UNKNOWN.

MITRE ATT&CK techniques by tactic:

Collection

T1005 Data from Local System; T1119 Automated Collection; T1560.002 Archive via Library

Defense Evasion

T1027 Obfuscated Files or Information; T1036.005 Match Legitimate Resource Name or Location

Execution

T1059.006 Python

Initial Access

T1078 Valid Accounts; T1195.002 Compromise Software Supply Chain

Discovery

T1082 System Information Discovery

Command and Control

T1132.001 Standard Encoding

Credential Access

T1528 Steal Application Access Token; T1552.001 Credentials In Files; T1552.005 Cloud Instance Metadata API

Persistence

T1546 Event Triggered Execution

Exfiltration

T1567 Exfiltration Over Web Service

Remediation

Patches

  • Pin agent-framework==1.26.0 (last clean release) and rebuild affected images and environments from a known-clean base

Immediate actions

  • Check site-packages (including CI caches and container images built since 2026-11-17) for agent_framework_meta.pth and af_runtime_diag.pth, and run 'pip show agent-framework' to identify versions 1.26.1 or 1.26.2
  • Isolate affected hosts, containers and runners; avoid running pip or Python in the affected environment because interpreter startup re-triggers the hook
  • Treat all secrets readable on affected systems as compromised and rotate them from a clean system: CI secrets, cloud keys, Azure service principal credentials, Azure DevOps PATs and service connections, GitHub/npm/PyPI/Hugging Face tokens, Docker registry credentials, .env contents
  • Search proxy, DNS and firewall logs for webhook.site, the path d381fd80-ec62-42ad-8f5c-d1b15103c9bb and the User-Agents af-runtime-diagnostics/1 and runtime-diagnostics/1; distinguish blocked attempts from completed transfers
  • Review Entra ID sign-in logs for pipeline/workflow service principals and federated credentials since 2026-11-17

Workarounds

  • Block agent-framework 1.26.1 and 1.26.2 in package-proxy/mirror controls
  • Uninstalling the package is not sufficient for data already exfiltrated; rotate credentials regardless

Longer-term hardening

  • Use hash-pinned lockfiles and a cooldown period before adopting newly published package versions
  • Restrict CI runner egress to an allowlist that excludes webhook.site and other generic webhook/paste services
  • Audit GitHub OIDC permissions, Azure federated credentials, Azure DevOps service connections and managed-identity role assignments to minimize blast radius; note that disabling trust does not revoke tokens already issued
  • Deploy EDR/behavioral detection for package-manager-descendant processes accessing secret files or IMDS (e.g., Elastic Defend rules for package install ancestry and IMDS requests)
  • Require trusted-publishing provenance attestations for internal dependency policies and alert on wheel-only releases lacking provenance

Affected and fixed versions

  • Microsoft — agent-framework (Microsoft Agent Framework meta-package, PyPI)
    Vulnerable versions: 1.26.1; 1.26.2
    Fixed in: 1.26.0 (last clean release; malicious versions removed from PyPI)

Timeline

  • Clean agent-framework 1.26.0 published to PyPI at 18:24 UTC (wheel and sdist); it remains the last known clean version.
  • 1.26.2 quarantined at about 21:16 UTC (StepSecurity: 21:16:44); both malicious versions removed within the hour and 1.26.0 became the latest release again.
  • Malicious 1.26.2 uploaded at 21:08 UTC (2 min 23 s after the first quarantine) using renamed components [file name withheld]/[file name withheld], a new User-Agent runtime-diagnostics/1 and an added GitHub Actions OIDC collector, showing the attacker retained publishing access.
  • PyPI quarantined 1.26.1 at about 21:06 UTC (StepSecurity: 21:06:16).
  • Elastic's supply-chain monitor flagged 1.26.1 as malicious at about 20:41 UTC, roughly six minutes after publication; Elastic posted initial details on X that evening.
  • Malicious agent-framework 1.26.1 uploaded at 20:35 UTC (wheel only, no provenance, uploader user-agent RestSharp/106.13.0.0) with the [file name withheld] startup hook and [file name withheld] stealer.
  • Per StepSecurity, a maintainer account named vibiret was created and added to the agent-framework project on the day of the attack; the initial access vector is not established by any source.
  • Elastic Security Labs and BleepingComputer published analyses; no source attributes the campaign to a named actor and Microsoft had not commented on the publishing-access breach at the time of reporting.

Sources cited

Further reading

AI-drafted from 9 cited sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats