OAK — OnChain Attack Knowledge

Worked example · 2024-07

Bittensor — malicious bittensor 6.12.2 package on PyPI sent users' decrypted coldkeys to an attacker's server, and about 32,000 TAO was drained — Bittensor / TAO — 2024-07-02

Loss
~32,000 TAO, about $8M, taken from owners of some validators, subnets and miners over roughly three hours on 2024-07-02 (Rekt, The Block). The sources give no count of wallets or victims; Coinlive repeats the 32,000 TAO figure.
Recovery
none reported; the Opentensor Foundation (OTF) says it is working with exchanges to trace the attacker and try to recover funds (The Block). TAO fell about 15% after the incident.
OAK Techniques observed
OAK-T15.002 (Supply-Chain / Vendor-Pipeline Compromise — primary, operator-stated). OTF traced the attack to a malicious upload of version 6.12.2 to the PyPI package manager, posing as the legitimate Bittensor library (The Block). When users decrypted their coldkeys, the key material was sent to a server the attacker controlled (Rekt). See techniques/T15.002-supply-chain-vendor-pipeline-compromise.md. OAK-T11.002 (Wallet-Software Distribution Compromise — secondary): the package is the client through which users stake, transfer and delegate, and the key theft happens at the point their wallet is unlocked. See techniques/T11.002-wallet-software-distribution-compromise.md. How the attacker obtained the right to publish to PyPI is undisclosed. No source opened describes laundering, so no laundering Technique is claimed.
Attribution
unattributed — ZachXBT identified the address that received the stolen funds, 5FbWTraF7jfBe5EvCmSThum85htcrEsCzwuFjG3PukTUQYot, and may have tied it to an earlier theft of over 28,000 TAO on 2024-06-01 (Rekt). No named actor or group is given in the sources opened.
Key teaching point
Do not unlock a coldkey inside a Python environment that auto-installs the newest release of a wallet package; pin a reviewed version and compare the PyPI file with the GitHub tag. In this incident a user needed only to install 6.12.2 and then decrypt a coldkey to stake, unstake, transfer, delegate or undelegate (Rekt).

Summary

Bittensor's Python package, bittensor, is the client users run to stake, transfer and delegate TAO. A malicious version, 6.12.2, was uploaded to PyPI and posed as the real package. Users who downloaded the package between 2024-05-22 and 2024-05-29, or who used Bittensor==6.12.2, and then staked, unstaked, transferred, delegated or undelegated were affected (Rekt). The drain began on 2024-07-02 at 19:06 UTC. OTF flagged an abnormality in transfer volume at 19:26 and put its validators behind a firewall in safe mode at 19:41 (The Block). OTF says the blockchain and Subtensor code were not affected and published its post-mortem on 2024-07-03 (OTF on X).

The sibling file 2024-07-bittensor-pypi-package-coldkey-theft.md covers the same incident; this file is not a separate cohort event.

Timeline (UTC)

Entry: the malicious release. Preparation: the exposure window. Execution: the drain. Money: one receiving address is public; onward movement is undisclosed in the pages opened. Response: safe mode, removal of the package, the post-mortem.

When What happened OAK
2024-05-22 to 05-29 Users who download the PyPI package in this window, or use Bittensor==6.12.2, are exposed when they then stake, unstake, transfer, delegate or undelegate. The malicious code steals unencrypted coldkey details and sends them to the attacker's server (Rekt). How the upload was made is undisclosed. T15.002
2024-06-01 Over 28,000 TAO ($11.2M at the time) is stolen from one holder; ZachXBT may have tied the later receiving address to this theft (Rekt). Not established as the same mechanism. —
2024-07-02 19:06 The attack begins and the attacker moves funds from affected wallets to its own (The Block). About three hours in total (Rekt). T11.002
2024-07-02 Receiving address identified by ZachXBT: 5FbWTraF7jfBe5EvCmSThum85htcrEsCzwuFjG3PukTUQYot. Onward movement, swaps and laundering: undisclosed in the pages opened. No transaction hashes are printed in full. —
2024-07-02 19:26 OTF flags an abnormality in transfer volume (The Block). response
2024-07-02 19:41 OTF places the chain validators behind a firewall and enters safe mode on Subtensor (OTF on X). Blocks continue to be produced but transactions are not processed (Rekt). response
2024-07-03 OTF publishes its post-mortem; removes 6.12.2 from PyPI, reviews the Subtensor and Bittensor code, and works with exchanges to trace the attacker (Rekt, OTF on X). response
2024-07-04 The Block reports that the last transaction finalised about 35 hours earlier and that the chain will resume gradually; affected users are told to create a new wallet and move funds once it does (The Block). response

Key addresses:

Root-cause evidence

Public references

Techniques demonstrated (2)

More incidents