OAK — OnChain Attack Knowledge

Worked example · 2022-04

Elephant Money — a flash loan moved the ELEPHANT price through the TRUNK mint path, then TRUNK was redeemed at the inflated value — Elephant Money (ELEPHANT / TRUNK) / BNB Chain — 2022-04-12

Loss
~$11.2M as stated by Elephant Money (about 27,416 BNB), as relayed by Blocktempo and U.Today; REKT also gives $11.2M for the team's post-mortem. Disputed: PeckShield said roughly 30 billion ELEPHANT tokens were left out of the team's figure, which REKT puts at a total of $22.2M and Blocktempo says were worth at least $11M.
Recovery
none reported in the pages opened. The team's own post-mortem (Medium) returned HTTP 403 and was not read.
OAK Techniques observed
OAK-T9.001 (Oracle Price Manipulation — primary, per BlockSec as relayed). The attacker bought ELEPHANT with flash-loaned WBNB, then minted TRUNK with BUSD; the vulnerable contract swapped the BUSD into ELEPHANT on the AMM, pushing the ELEPHANT price up while the attacker held ELEPHANT. TRUNK and ELEPHANT were then sold or redeemed at the inflated value. See techniques/T9.001-oracle-price-manipulation.md. OAK-T9.002 (Flash-Loan-Enabled Exploit — the capital: a flash loan of WBNB, plus BUSD per REKT). See techniques/T9.002-flash-loan-enabled-exploit.md. OAK-T7.001 (Mixer-Routed Hop — Blocktempo reports the attacker's initial funds came from Tornado Cash and part of the proceeds went back to it; REKT says funds were bridged to Ethereum or sent to Tornado Cash). See techniques/T7.001-mixer-routed-hop.md.
Attribution
unattributed (no opened source names an actor; no attacker address is given on any opened page).
Key teaching point
A mint or redeem path must not trade on a spot AMM price that a flash loan can move in the same transaction. Here the contract's own BUSD-to-ELEPHANT swap during minting raised the price the attacker was about to sell into; a per-transaction cap, a TWAP or a deviation check on the reserve's swap would break that step. REKT reports that the auditor, Solidity Finance, did not tell Elephant about the price-manipulation vulnerability.

Summary

On 2022-04-12 an attacker flash-borrowed WBNB (131,162 WBNB per Blocktempo; 131k WBNB and 91M BUSD per REKT), bought ELEPHANT, minted TRUNK with BUSD (which, through a flaw in the vulnerable contract, pushed the ELEPHANT price higher), then sold ELEPHANT for WBNB and redeemed TRUNK for about 36,987 WBNB and 66,884,140 BUSD (Blocktempo). BlockSec estimated about $4M profit per round and that the attacker could repeat it (U.Today; The Record). REKT says the cycle was repeated for total gains of over 27k WBNB. ELEPHANT fell by roughly 75 to 89% depending on source and baseline, and TRUNK dropped to a low of $0.591 per Blocktempo. The team paused the Reserve, disabling TRUNK minting and redemption, and engaged CertiK and InsurAce.

Timeline (UTC)

Stages: Preparation → Execution → Money → Response. No source opened gives block times; dates are as reported.

When What happened OAK
Before 2022-04-12 (undisclosed) The TRUNK mint/redeem path was live with a swap into ELEPHANT on-chain that an outside buyer could move. The attacker's initial funds came from Tornado Cash, per Blocktempo. T7.001
2022-04-12 Attacker flash-borrows WBNB (REKT: 131k WBNB and 91M BUSD), swaps about 131,162 WBNB for ELEPHANT, mints TRUNK with BUSD, which raises the ELEPHANT price, then sells ELEPHANT and redeems TRUNK, repays the loans and keeps the difference; repeated. Example transaction: 0xec317deb2f3efdc1dbf7ed5d3902cdf2c33ae512151646383a8cf8cbcd3d4577 (hash from REKT and Blocktempo; attacker contract and EOA undisclosed in the pages opened). T9.001, T9.002
2022-04-12 to 2022-04-13 About 5% of proceeds sent back to Tornado Cash and 3,472 ETH withdrawn from it (Blocktempo); REKT says funds went to various accounts, then bridged to Ethereum or sent to Tornado Cash. Hop addresses undisclosed. T7.001
2022-04-12 Elephant Money pauses the Reserve (TRUNK minting and redemption off), tells users not to sell, states the $11.2M loss and works with CertiK and InsurAce. response
2022-04-12 / 2022-04-13 BlockSec calls it a "traditional price manipulation attack" and warns of about $4M profit per round; PeckShield disputes the loss figure. response

Key addresses:

  • Vulnerable contract named in Blocktempo's article — 0x1befe6f3f0e8edd2d4d15cae97baee01e51ea4a4. Blocktempo says BlockSec earlier suspected a migrate() flaw in it in a separate BSC attack and that this is not confirmed as the root cause here, so it is listed only as named, not as the confirmed victim contract.
  • Attacker EOA, attack contract and holding wallets: undisclosed in the pages opened.

Where the funds went (hops undisclosed)

Not traced by OAK and not given hop by hop with full addresses in any page opened (REKT and Blocktempo give only the Tornado Cash and bridge description above), so no oak-flow block is written. The date does not require one.

Root-cause evidence

Public references

Techniques demonstrated (3)

More incidents