Worked example · 2022-03
Paraluni MasterChef reentrancy exploit — BNB Chain — 2022-03-13
Summary
On 2022-03-13 at 00:04:30 UTC the attacker exploited Paraluni's MasterChef contract. Per CertiK, two flaws combined: depositByAddLiquidity() did not validate that the _pid pool ID matched the supplied _tokens, and the contract lacked reentrancy protection [certikparaluni]. The attacker created two malicious tokens, UBT and UGT; UBT's transferFrom() called MasterChef's deposit() before internal state was updated, so the same 155,935 LP tokens were credited twice, creating two userInfo records, and the attacker withdrew through both paths [certikparaluni].
The attacker borrowed about 157,000 USDT and 157,000 BUSD from PancakeSwap to build the LP position, then removed liquidity, repaid the flash loans and kept about 310,000 USDT and 310,000 BUSD. The proceeds were swapped to ETH, bridged from BSC to Ethereum and 660 ETH was deposited into Tornado Cash [certikparaluni].
Timeline (UTC)
| When | Event |
|---|---|
| 2022-03-13 00:04:30 | MasterChef exploit begins; about $1.7M taken over several transactions [certikparaluni] |
| After | Proceeds bridged to Ethereum; 660 ETH to Tornado Cash in 12 installments [certikparaluni] |
Public references
[certikparaluni]— CertiK, "Paraluni Exploit" (2022-03): https://www.certik.com/resources/blog/4mPLWLwyKG4xy30x65uLgw-paraluni-exploit- Cross-reference: T9.002 at
techniques/T9.002-flash-loan-funded-attack.md; T9.005 (Reentrancy) attechniques/T9.005-reentrancy.mdis the better mechanism match.