Soda Protocol Hack
What happened
On September 20, 2020, one day after its contracts went live, attackers exploited the Soda.Finance lending pool on Ethereum. Anyone could liquidate healthy WETH loans because a wrong variable in WETHCalculator.sol made the liquidation check in collectDebt() always pass. AnChain.AI reported that more than 400 ETH (around $160,000) was liquidated from the pool.
The Soda team counted 17 affected addresses, 12 of which had a total of 448.339 WETH in locked principal liquidated. Because borrowers kept the SoETH they had borrowed against that collateral, the team put the victims' actual loss at 134.5017 WETH, about 30% of the principal. It offered to compensate victims for that 30% in SoETH from the SodaDev pool, offered a 1 ETH reward to the Weibo user who first found and reported the bug, and said it was preparing a full security audit.
How it happened
- Soda let users lock WETH as collateral and borrow SoETH up to a maximum loan-to-value (15-95%).
collectDebt()let a third party liquidate a loan only whenloanTotal >= maximumLoan.maximumLoanshould have been computed from the loan'slockedAmount(the collateral).- The code computed it from
amount(the borrowed principal) instead. SinceloanTotalis principal plus interest and the LTV factor is below 1, the check passed for every loan. - Attackers called
collectDebt()on healthy loans and liquidated 448.339 WETH of locked principal from 12 addresses, per the team's count. - The team patched the contract, replacing
amountwithlockedAmountin the calculation.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.