PREFACE
Lava is a lending protocol that focuses on enabling the collateralization of AMM liquidity positions. This comes with different challenges and risks that the protocol has various controls for and aims to continuously mitigate in order to unlock an important and unique asset type. This report is divided into two sections: an operational response review and a technical incident report that details which controls and how those controls were circumvented in the USDC-USDC.e LP contract and what mitigations have been introduced in order to prevent future incidents.
OPERATIONAL RESPONSE
The incident was reported by PeckShield Alert to the protocol on March 28, 2024. Within 15 minutes of reviewing the report, all lending markets on the protocol were paused to prevent any further exploits. Lava community members reached out to contacts at major exchanges to identify the exploit address and prevent potential off-ramping of assets. Within an hour and with coordination of major exchanges, law enforcement incidents were filed. The address has also been listed as a malicious address on the blockchain explorer Arbiscan (Etherscan).
All affected addresses were identified and a contingency plan was enacted for compensation by the Insurance Fund, not dependent on the successful return of funds by the attacker.
An on-chain message was delivered to the attack address and the final recipient address of exploited funds in accordance to the protocol's exploit response procedures stipulating ongoing investigations will be halted if the attacker returns 90% of user funds.
Attack Address:
0x851aa754c39bf23cdaac2025367514dfd7530418
Final Attacker Recipient Address: 0xFBcDB6CECA13b0e2ca51e86C94D78fAaB10A6428
Lava has redeployed new contracts and will redeploy an updated LP contract. Affected addresses will be compensated according to the compensation plan discussed in the community chat.
TECHNICAL INCIDENT REPORT
USDC-USDC.e address: 0x10bdA01aC4E644fD84a04Dab01E15A5eDcEE46dD
State before the attack (block no. 195240642):
Attack:
Date: Mar-28-2024 10:57:33 PM +UTC
Block No: 195240643
Transaction: 0xcb1a2f5eeb1a767ea5ccbc3665351fadc1af135d12a38c504f8f6eb997e9e603
Events:
The wrapper now has 1097126341300 shares and 1108080214664 liquidity. This amount of liquidity corresponds to roughly 55 USDC and 55 USDC.e. So far all of the logic was executed correctly.
The wrapper also has $81 worth of pending USDC fees (and no USDC.e fees). The wrapper now mistakenly includes the $81 worth of fees as its legitimate assets. Since the underlying liquidity value is just $110, the addition of $81 worth of fees increases the LPT price by 72%. This gives the account with the LPT token as collateral enough borrow power to borrow out all of Lava's assets.
Donating assets to the wrapper via trading fees was identified as an attack vector. The wrapper tries to prevent this problem by limiting trading fees to a maximum APR value but only if both token0 and token1 trading fees breach the limit. In this case only token0 generated fees were over the limit, but token1 fees were not and the check was not triggered.
If the check was implemented with a logical "or" operator instead of "and" the attack would fail.
Summary:
Mitigation: