Original Title: "Alpha Finance $37.5M Hack Retrospective, Hacker Had Inside Information"
Original Source: The Defiant
DeFi's dark arts continue to be the most lucrative.
Below is one of the most dramatic stories we have encountered to date.
A tale of false magic, chaos, and accusations has led to what is by far the biggest DeFi hack to date.
Approximately $37.5 million was stolen in a convoluted DeFi scam, with the attack using multiple transactions to raid Alpha Finance's coffers, simultaneously leading many to believe that the Cream Iron Bank was affected.

This murder mystery took place in a hall of mirrors, the increasingly intertwined nature of DeFi protocols, coupled with the complexity of the attack, has left the community perplexed as to who the true victim is and who should be responsible for making them whole.
The attacker's contract tricked Homora's code into "believing" their malicious contract was its own, with the aim of manipulating the amount of internal debt in the system.
It was a private battle between the protocol and the attacker. The exploited contract has not been disclosed nor made available to users, meaning they weren't directly affected. We've yet to see such a brazen inside job, and Alpha Finance quickly pointed out that they had found a "prime suspect."
If the contract wasn't ready, why deploy it on the mainnet?
Amidst the chaos, whales swiftly took action to safeguard their capital. SBF withdrew $400 million worth of FTT from Cream Finance, while Three Arrows Capital sent over $3 million worth of ALPHA tokens to Binance, possibly with the sole aim of dumping them.
errorHomoraBankv2 accepts any custom spell, as long as the invariant check passes collateral>borrow (similar to a Yearn strategy spell);
With so many eyes on them, the aggressor left behind clear clues, and in a rare counterstrike, the victim singled out the attacker.
The above requirements prove that executing this attack required insider information. However, due to the protocol and auditing firm involvement, insiders could be multiple.
rekt is no longer in the business of making accusations, but we look forward to seeing how Alpha Finance handles this situation.
Below is Alpha Finance's account:
The attacker crafted an evil spell (equivalent to Yearn's strategy) https://etherscan.io/tx/0x2b419173c1f116e94e43afed15a46e3b3a109e118aba166fcca0ba583f686d23
The attacker swapped ETH for UNI and provided ETH+UNI to the Uniswap pool (receiving ETH/UNI LP tokens). In the same transaction, on Uniswap, they exchanged ETH for sUSD and deposited sUSD into Cream's Iron Bank (receiving cysUSD) https://etherscan.io/tx/0x4441eefe434fbef9d9b3acb169e35eb7b3958763b74c5617b39034decd4dd3ad
Using an evil spell, call execute on HomoraBankV2 to: borrow 1000e18 sUSD, deposit UNI-WETH LP to WERC20, using it as collateral along the way (bypassing collateral > borrow check), the attacker ends up with a 1000e18 sUSD debt position (as the attacker is the first borrower) https://etherscan.io/tx/0xcc57ac77dc3953de7832162ea4cd925970e064ead3f6861ee40076aca8e7e571
Again, using an evil spell, call execute on HomoraBankV2 to: repay 100000098548938710983 sUSD (actual should-be-interest-accrued debt is 100000098548938710984 sUSD), causing repayment to be 1 less than the total share. As a result, the attacker now holds 1 minisUSD debt and 1 debt share.https://etherscan.io/tx/0xf31ee9d9e83db3592601b854fe4f8b872cecd0ea2a3247c475eea8062a20dd41
Call resolveReserve on the sUSD bank, generating 19709787742196 debt while totalShare is still 1. Current state: totalDebt = 19709787742197, and totalShare = 1 https://etherscan.io/tx/0x98f623af655f1e27e1c04ffe0bc8c9bbdb35d39999913bedfe712d4058c67c0e;
Evil spell called execute again on HomoraBankV2, executing (repeated 16 times, each time doubling the borrowed amount): Borrowed 19709787742196 USD and transferred to the attacker (doubling each time because totalDebt doubles after each successful borrow). Each borrow was slightly less than the totalDebt value by 1, resulting in the corresponding borrow share being =0, hence the protocol treats it as a zero-debt borrow. At the end of the transaction, the attacker deposited 19.54 sUSD into Cream's Iron Bank.https://etherscan.io/tx/0x2e387620bb31c067efc878346742637d650843210596e770d4e2d601de5409e3
Continuing this process: Evil spell called execute again on HomoraBankV2, executing (repeated 10 times, each time doubling the borrowed amount). At the end of the transaction, the attacker deposited 1321 sUSD into Cream's Iron Bank, https://etherscan.io/tx/0x64de824a7aa339ff41b1487194ca634a9ce35a32c65f4e78eb3893cc183532a4;
Borrowed 1,800,000 USDC through Aave's flash loan, then swapped this 1,800,000 USDC for 1770757.5625447219047906 sUSD, and deposited it into Cream to provide the attacker with enough liquidity to use a custom spell for borrowing, continuing to double the sUSD borrowings from 1322.70 sUSD to 677223.15 sUSD (in total 10x). Swapped 1353123.59 sUSD for 1374960.72 USDC, borrowed 426659.27 USDC from Cream (since the attacker had deposited sUSD in step b) https://etherscan.io/tx/0x7eb2436eedd39c8865fcc1e51ae4a245e89765f4c64a3200c623f676b3912f9
Repeat Step 8, this time for an amount of approximately 10 million USDC, https://etherscan.io/tx/0xd7a91172c3fd09acb75a9447189e1178ae70517698f249b84062681f43f0e26e;
Repeat for 10 million USDC, https://etherscan.io/tx/0xacec6ddb7db4baa66c0fb6289c25a833d93d2d9eb4fbe9a8d8495e5bfa24ba57
Borrow 13244.63 WETH + 3.6 million USDC + 5.6 million USDT + 4.26 million DAI, supply to Aave for Stablecoins (to receive aToken, hence USDC and USDT cannot be frozen), and supply to Curve a3Crv pool for aDAI, aUSDT, and aUSDC, https://etherscan.io/tx/0x745ddedf268f60ea4a038991d46b33b7a1d4e5a9ff2767cdba2d3af69f43eb1b
Add the a3Crv LP token to Curve's liquidity gauge https://etherscan.io/tx/0xc60bc6ab561af2a19ebc9e57b44b21774e489bb07f75cb367d69841b372fe896
The remaining transactions send funds to Tornado Cash and GitCoin Grants, with 1000 ETH sent to Cream and Alpha's deployer address.

This story is very unique and suspicious.
When it comes to white hat / black hat activities, we always expect to see role reversals, but we rarely see the victim so clearly pointing fingers.
Andre Cronje, who facilitated the collaboration between Yearn and Alpha Homora weeks ago, wrote about the attack:
「I took some time to investigate this attack, 9 transactions, 4 different manipulations, one involving precise debt calculations that required the research team to spend several hours to figure out. Alpha immediately took steps to mitigate the vulnerability issue and resolved it within minutes of discovering the problem.」
Meanwhile, Banteg's response was:
「This event is absolutely insane. It is impossible for anyone to casually look at the contract and especially the ones that are unannounced to spot this.」
Perhaps this could lead to another Yearn acquisition case. Cronje's name was mentioned four times in the investigation report, and indeed, this pattern looks very familiar.

Due to the very small possible suspect list, it is easier to rule out and trace potential attackers, with the list being even smaller in this case than usual.
When it comes to dealing with code, 'Don't trust, verify' is an excellent motto, but it cannot stop the growing societal paranoia. We are experiencing an unprecedented period of growth in cryptocurrency and DeFi, where the cost of not working is very high. The mental burden on DeFi developers is increasing.
An empire is built on lines of code, and the future of finance is right before our eyes.
Developers are caught in competition, while corrupt insiders help hackers work underground, digging holes on their foundations.
When one tower collapses, all other towers will watch and learn. Before the dust settles, the crowd is already moving forward, and resilient teams will return to the field to seek greater strength.
How long can they hold on before the inevitable mistake causes their anonymous cloaks to slip off?
Original Article Link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia
