Armando found that anthropic-sdk v0.1.0, published to PyPI on 2026-10-04, is a downloader dressed up as a "community companion" for the official Anthropic Python SDK (which ships on PyPI as anthropic). Nothing runs at install time. Instead, every import of anthropic_sdk is counted, and from the third import onward the package fetches Python source from a GitHub repository served through the jsDelivr CDN, caches it on disk, and executes it. The second stage is a stealer aimed squarely at AI developers: it collects Anthropic and OpenAI API keys, cloud and Git credentials, SSH keys, MCP configurations and recent Claude Code session transcripts, and sends them to telemetry-edge.net, with a DNS tunnel as a fallback.
Key Findings
- Malicious version: v0.1.0, published 2026-10-04 17:53 UTC; it is the only version of the package, so there is no clean predecessor
- Entry point: import-time execution --
import anthropic_sdk loads __init__.py, which imports _usage.py, whose module-level code arms the downloader. Running the anthropic-sdk console script triggers the same import chain. There is no install-time hook: the sdist uses the stock setuptools build backend and ships no setup.py
- Targets: developers using AI tooling on any platform running Python 3.8+ -- Anthropic and OpenAI API keys, AWS, GitHub and GitLab tokens, SSH keys, kube, Docker, npm and Git credentials,
.env files, Claude Code, Cursor, Copilot, Continue, Windsurf, Codeium, Aider, Ollama and LM Studio data, and the five most recent Claude Code session transcripts
- Exfiltration: gzip-compressed JSON POSTed to
https://telemetry-edge.net/api/v2/ingest; if that fails, environment secrets are hex-encoded into DNS lookups under x.telemetry-edge.net
- Evasion: activation is delayed until the third import, the second stage is fetched over a popular CDN and can be swapped at any time, it scores the host for sandbox and analysis traits (including environment variables of security scanners) and aborts on a high score, it checks a DNS TXT kill switch, it filters out credential values that look fake, and all failures are silent
- Detection: Script-Python.Downloader.SupplyChain, Text.Downloader.SupplyChain, Archive-ZIP.Downloader.SupplyChain, Archive-GZIP.Downloader.SupplyChain, Archive-TAR.Downloader.SupplyChain
Package Background
anthropic-sdk describes itself as a "Community SDK companion for the Anthropic API: thin re-export of the official anthropic package with convenience helpers." Its README tells users that import anthropic_sdk as sdk gives them the same Anthropic client as the official package. The name is the point: "anthropic-sdk" is exactly what a developer might type when looking for Anthropic's Python SDK.
The package first appeared on 2026-10-04 and has a single release. It declares https://github.com/asdk-community/anthropic-sdk as its homepage, but there is no v0.1.0 tag there, and the GitHub organization could not be found at the time of analysis. The README also says the package "intentionally depends on the official anthropic release" -- yet the metadata declares no dependencies at all. The re-export is cosmetic: if the official SDK happens to be installed it is re-exported, and if not, the failure is silently ignored. At the time of writing, PyPI's JSON API returns 404 for the project.
Attack Analysis
The package is four small Python modules, and three of them form a single chain.
Step 1 -- the cover. __init__.py opens with a wildcard re-export of the official anthropic package, wrapped in a try/except so it never fails. To a reviewer skimming the file, that is the whole package. The last lines quietly import _usage, again inside a try/except that swallows any error.
Step 2 -- the counter. _usage.py runs code at module level the moment it is imported. It keeps an import counter in ~/.config/anthropic-sdk/usage.json and does nothing visible for the first two imports. From the third import onward it calls _check.load_and_run(). Waiting for repeated use is a deliberate choice: a sandbox or a curious analyst who imports the package once or twice sees no network traffic at all.
Step 3 -- the downloader. _check.py presents itself as an "update check." It requests https://cdn.jsdelivr.net/gh/shred0day/payload@main/payload.py with the User-Agent asdk/0.1.0, base64-encodes the response, and stores it with a timestamp in ~/.config/anthropic-sdk/lr.json. The cache is refreshed at most once every 24 hours. The source is then compiled and executed in a fresh namespace, and if it defines an entry() function, that function is called. Every step is wrapped so that failures are invisible.
The result is a package that carries no payload of its own. What runs on a victim's machine is whatever the attacker has committed to the main branch of shred0day/payload at the time of the fetch -- and jsDelivr fronts it with a trusted, widely allow-listed CDN domain. Because the second stage is retrieved at runtime, its behavior can change at any time without a new PyPI release.
A fourth module, cli.py, backs the anthropic-sdk console script. It contains its own copy of the third-run "update check" trigger, but its main() never calls it. That code is dead, yet the CLI still activates the chain, because loading anthropic_sdk.cli first imports the package's __init__.py.
Stage two: a stealer built for AI developers
Armando retrieved payload.py from the repository as text and analyzed it without executing it. The repository holds a single commit (fd26aa04, "Initial release", 2026-10-04 17:17 UTC), and the copy served by jsDelivr is identical to the one on GitHub (SHA256 66a6f755522497c1bd7dc95e2d24a1550770d50c34387d3af3d4bc94418a62ee). Its docstring claims it "collects local install stats and reports them". Every string that would give it away is stored as a list of character codes.
entry() starts a background daemon thread so the importing program is never delayed. Before collecting anything, the thread runs four gates:
- Sandbox score. It adds points for a host name containing words such as
sandbox, malware, detonate, analysis, cuckoo or vm; for environment variables starting with SOCKET_, SNYK_ or OSSF_, which belong to supply chain security scanners; for VMware and VirtualBox MAC address prefixes; for fewer than two CPUs, less than 2 GB of RAM or less than five minutes of uptime; and for marker paths such as /tmp/detonate, /tmp/sandbox, C:\sandbox and C:\analysis. Resource penalties are forgiven on CI runners (GITHUB_ACTIONS, GITLAB_CI, CI, BUILD_ID, JENKINS_HOME) so that pipelines still qualify. A score of three or more ends the run.
- Once a day. It skips the run if
~/.config/anthropic-sdk/lr.json holds a timestamp from the last 24 hours.
- Kill switch. It looks up the TXT record of
_ks.telemetry-edge.net and stops if the answer starts with 1 or on, which lets the operator pause collection without touching the package.
- Jitter. It sleeps a random 5 to 30 seconds.
It then collects:
- Environment variables whose names start with
AWS_, GITHUB_, GITLAB_ or SSH_ or contain TOKEN, SECRET, API_ or PRIVATE. Values are checked for plausibility -- AWS secrets must be 40 characters, GitHub tokens must start with ghp_, gho_ or ghs_, OpenAI keys with sk- and Anthropic keys with sk-ant- -- apparently to drop placeholders and decoy credentials.
- Credential files:
~/.ssh/id_rsa, ~/.ssh/id_ed25519, ~/.aws/credentials, ~/.kube/config, ~/.npmrc, ~/.docker/config.json, ~/.git-credentials, ~/.netrc, ~/.claude.json, ~/.cursor/mcp.json and .mcp.json in the working directory, plus .env files in ~/.anthropic and ~/.openai.
- AI tool data: up to eight
.md, .json, .jsonl or .yaml files each from ~/.continue, ~/.windsurf, ~/.codeium, ~/.open-interpreter, ~/.ollama and the GitHub Copilot, ChatGPT and LM Studio application folders, plus Aider's .aider.chat.history.md.
- Claude Code transcripts: the five most recently modified
.jsonl session files under ~/.claude/projects, up to the last 512 KB of each. Those transcripts can contain source code, secrets pasted into prompts and tool output.
- Project secrets: every
.env* file up to two directory levels below the current working directory.
The result, tagged with host name, user name, platform and working directory, is gzip-compressed and POSTed as JSON to https://telemetry-edge.net/api/v2/ingest with the User-Agent asdk/0.1.0. If the POST fails, a trimmed copy holding only the metadata and environment secrets is hex-encoded into DNS lookups of the form <n>.<hex>.x.telemetry-edge.net, up to 1,800 bytes, so the data can leave networks that block direct HTTPS.
A self-inflicted bug. The once-a-day gate in stage two reads and writes the same ~/.config/anthropic-sdk/lr.json file that stage one uses as its payload cache, and stage one only ever runs the payload right after stamping that file with the current time or from a cache entry less than 24 hours old. As committed on 2026-10-04, stage two therefore sees a fresh timestamp on every run and stops before collecting anything, except on hosts where that directory cannot be written. This is a flaw in the attacker's code, not a safeguard: stage one fetches payload.py again every 24 hours, so a one-line fix in the repository would arm every machine that already has the package installed.
The publisher. The PyPI account behind the release is shred0day, the same handle that owns the GitHub repository hosting the second stage; the commit was authored as shred0day@proton.me. That GitHub account was created on 2026-05-31, has no followers and two public repositories: a fork of an advisory database, and payload (description: "SDK update utilities"). The payload repository was created at 17:17 UTC on 2026-10-04, about 36 minutes before anthropic-sdk was published to PyPI. The intel phase flagged it as a stager repository. The PyPI account has no other packages, so this looks like a purpose-built, single-package operation rather than a compromised maintainer.
Malicious Files
__init__.py is the package entry point. It provides a cover re-export of the official anthropic package, which is not even declared as a dependency, followed by a silent from . import _usage. That import arms the import counter that fetches and executes remote code from cdn.jsdelivr.net/gh/shred0day/payload@main/payload.py on the third import.
_usage.py is the import-time trigger. Its module-level _boot() runs on every import anthropic_sdk and counts imports in ~/.config/anthropic-sdk/usage.json. From the third import on, it calls _check.load_and_run(), which downloads and executes remote Python from cdn.jsdelivr.net/gh/shred0day/payload. Delayed activation acts as sandbox evasion, and exceptions are swallowed silently.
_check.py is the second-stage downloader and executor. load_and_run() fetches Python source from the hardcoded https://cdn.jsdelivr.net/gh/shred0day/payload@main/payload.py (User-Agent asdk/0.1.0) and caches it base64-encoded in ~/.config/anthropic-sdk/lr.json with a 24-hour TTL. It then runs the code via exec(compile(...)) and calls its entry(). All errors are swallowed silently, and the behavior has nothing to do with the stated "thin re-export of anthropic" purpose of a package impersonating the official Anthropic SDK.
cli.py is the target of the anthropic-sdk console script. Running the command imports the package and so arms the same download-and-execute chain, and the module carries its own copy of the third-run trigger for _check.load_and_run().
METADATA and pyproject.toml are the package manifests that ship the malicious modules above and present them under the anthropic-sdk name. The wheel anthropic_sdk-0.1.0-py3-none-any.whl and the sdist anthropic_sdk-0.1.0.tar.gz (and its inner .tar layer) contain the same malicious code; the Python modules are byte-identical across both distributions.
The second stage, payload.py, is not part of the package. It is the credential stealer described above, fetched from shred0day/payload at runtime, and the attacker can replace it at any time.
Recommendations
Developers and security teams should take the following steps:
- Identify exposure: Check whether anthropic-sdk v0.1.0 appears in your environments, requirements files, or lockfiles, including transitive dependencies. Any machine or CI pipeline that installed it and imported
anthropic_sdk at least three times should be considered potentially compromised.
- Remove the package: There is no clean release of anthropic-sdk. Uninstall it and use the official Anthropic SDK, published on PyPI as anthropic.
- Inspect affected systems: Look for the
~/.config/anthropic-sdk/ directory. usage.json records how many times the package was imported. lr.json normally holds a base64-encoded copy of the second stage that was fetched -- preserve it for analysis before deleting it. Review proxy and DNS logs for requests to cdn.jsdelivr.net/gh/shred0day/payload with the User-Agent asdk/0.1.0, any traffic to telemetry-edge.net, and DNS queries under x.telemetry-edge.net or for _ks.telemetry-edge.net, and block that domain.
- Rotate secrets: The flaw described above may have prevented collection on most machines, but that cannot be confirmed from the host alone. On any machine that imported the package three or more times, rotate Anthropic and OpenAI API keys, AWS, GitHub and GitLab tokens, SSH keys, npm, Docker and Git credentials, kube configs, secrets in
.env files and credentials referenced in MCP configurations, and review recent Claude Code sessions for sensitive content.
- Scan your software supply chain: Use Spectra Assure Community to check whether packages in your environment have been flagged.
Indicators of Compromise
Malicious Files
| Filename | SHA256 | Detection |
|---|
| init.py | 244ce6ffe0fe85213a36ee2849434ea39be69820b7414d9ebba3db9b95baf066 | Script-Python.Downloader.SupplyChain |
| _usage.py | 06a1e08e2f6a90b7f1b1d3dd1bb9a3f306d6424b4b616891761eedc3c7157704 | Script-Python.Downloader.SupplyChain |
| _check.py | c899f84c79509df93e9af69d71a404435c17bba3817748a682e52071ae361d47 | Script-Python.Downloader.SupplyChain |
| cli.py | 4fb83b0fedc3ae17c21384cf9d0360a01cf681f109628f9e9428301dfc7cb89a | Script-Python.Downloader.SupplyChain |
| METADATA | 2cd939c0256de871a14939e26b73f6fcd6218395ec58c608a30ba0b4ca8d52cd | Text.Downloader.SupplyChain |
| pyproject.toml | 64eccd2b8116d7e561efce506f2ebdda9c15cdaf476f12dd6c71408f04ab1fa1 | Text.Downloader.SupplyChain |
Network IOCs
| URL / IP | Purpose |
|---|
| https://cdn.jsdelivr.net/gh/shred0day/payload@main/payload.py | Second-stage Python payload fetched, cached and executed by _check.py (jsDelivr mirror of GitHub repo shred0day/payload) |
| https://raw.githubusercontent.com/shred0day/payload/main/payload.py | GitHub origin of the second-stage payload |
| telemetry-edge.net | Attacker exfiltration domain |
| https://telemetry-edge.net/api/v2/ingest | Exfiltration endpoint for gzip-compressed stolen data |
| _ks.telemetry-edge.net | DNS TXT kill switch checked before collection |
| x.telemetry-edge.net | DNS tunnel exfiltration zone (<n>.<hex>.x.telemetry-edge.net) |
Archive Hashes
| File | SHA256 |
|---|
| anthropic_sdk-0.1.0-py3-none-any.whl | af716c6ae37c94b76b54753718b2cdeb7147383523a311a559b0b40628466b5f |
| anthropic_sdk-0.1.0.tar.gz | 88aa47608004c5485a3623a0cb6c9675dca9a08ef5da945900deed08ea5a40ed |
| anthropic_sdk-0.1.0.tar | cb1c38fad7305163d5fc73e1e307a856917846ffc73b6e601167e467eb0f34ac |