LI.FI Hack
Incident Overview
Jul 16, 2024, DeFi Protocol LI.FI Hit by $8M Exploit
On July 16th, 2024, Li.Fi, a cross-chain DeFi protocol, suffered a significant exploit due to an arbitrary call vulnerability, resulting in a loss of approximately $8 million. The vulnerability resided in the depositToGasZipERC20 function within the GasZipFacet.sol contract. This function allowed the _swapData parameter to be passed directly to LibSwap.swap, which included a low-level call that could execute arbitrary functions.
Since the attacker had control over _swap.callTo and _swap.callData, they were able to craft malicious calldata with transferFrom() calls. With sufficient token spending approval, the attacker executed unauthorized transferFrom() calls to siphon funds from the protocol. Li.Fi has advised users to revoke approvals for specific addresses and has disabled the affected smart contract facet to contain the exploit.
This incident is particularly notable as it echoes a similar $600,000 loss in 2022 due to the same bug in the protocol’s swapping feature.
Attacker
https://etherscan.io/address/0x7742ed59…a7f2c8
Vulnerable contact
https://etherscan.io/address/0xf28a3523…d7e534#code
Attack tx:
https://etherscan.io/tx/0xd82fe84e…763873
https://etherscan.io/tx/0x65a92b18…692755
Incident Report
Protocol Information
What the Attacker Needed to Succeed
Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.
What Auditors Should Check
If you're auditing a protocol with similar architecture to LI.FI, these are the critical security checks that could have prevented this incident (July 2024).
- Verify all logic paths related to Other are guarded by proper access controls and input validation
- Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs
Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.
Free TrialSources & References
Learn to Prevent the Next LI.FI
The LI.FI hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.