Explore QuillAudits' analysis of LiFi Protocol’s $9.7M exploit. Dive into the details of this significant security breach in our latest blog post
On July 16, 2024, LiFi Protocol experienced a significant security breach that exploited the LiFi Diamond Contract. The exploit led to the loss of approximately $9.7 Million in various stablecoins and other assets at the time of writing. The attacker was able to drain funds from users who had granted infinite approvals to the contract. The LiFi Protocol team has taken immediate steps to contain the breach and mitigate further risks.
GasZipFacet
contract five days prior to the attack to enable gas refueling for bridging transactions.depositToGasZipERC20()
in the GasZipFacet contract, allowing unauthorized transactions.transferFrom
operations.
The exploit targeted users who had set infinite approvals for specific LiFi contract addresses. These approvals allowed the attacker to perform unauthorized transactions.
Five days before the attack, the LiFi team deployed the GasZipFacet contract to enable gas refueling for bridging transactions. This contract was designed to accept and swap a limited set of assets into supported ones (typically ETH).
The root cause is the possibility of an arbitrary call with user-controlled data via depositToGasZipERC20()
in GasZipFacet. The critical flaw was in the transaction call mechanism within the GasZipFacet contract. This transaction call, intended for asset swapping, was not validated and could be arbitrary. This allowed the attacker to craft a transaction call that executed a transferFrom
instead of a swap, effectively draining user balances.
Affected Contract Addresses:
Contract addresses in high risk:
The stolen assets, totaling around $9.7 million, were converted into approximately 2,857 ETH and distributed across multiple wallets. Specific amounts of the assets stolen include:
The root cause of the exploit was the arbitrary call vulnerability within the GasZipFacet contract. This vulnerability enabled the attacker to execute unauthorized transferFrom
operations by manipulating transaction calls.
Specifically, the flaw allowed for arbitrary calls with user-controlled data through the depositToGasZipERC20()
function in GasZipFacet. This function, designed for asset swapping, lacked proper validation and restrictions, permitting the attacker to craft malicious transaction calls. The swap
function didn’t check call target and call data.
As a result, the attacker was able to invoke transferFrom
actions, leading to the token loss of users who gave infinite approval to (LiFi Diamond) Contract.
Moreover, the Lifi protocol uses a diamondProxy pattern, which allows for switching the implementation contract based on the function selector, played a role in the exploit.
Initial Funding through Tornado Cash: The attacker received 0.95646735 ETH from Tornado Cash at address 0x7e6c0ec5a67e0ed34615b0b625c60c0e23f79c86.
Conversion to ETH:
https://metasleuth.io/result/eth/0x8B3Cb6Bf982798fba233Bca56749e22EEc42DcF3
swap()
function which allowed the contract to call any address with a message crafted by the attacker. This enabled the contract to execute transferFrom
operations unauthorized.
An auditing firm like QuillAudits can play a crucial role in preventing such exploits through the following measures:
A thorough review of the LiFi Protocol's smart contracts to identify and fix vulnerabilities would be essential. Implementing robust validation mechanisms to ensure that transaction calls are authorized and safe could have prevented unauthorized access and mitigated the risks associated with the exploit. Before deploying the GasZipFacet
contract in production, LiFi should have done a comprehensive audit of the contract. That way they could have identified the potential issue in depositToGasZipERC20()
function.
Implementing continuous monitoring and real-time alerts for suspicious activities and potential exploits is crucial. Regular audits should be conducted periodically to ensure that new features and updates do not introduce new vulnerabilities, thereby maintaining the security and integrity of the protocol.
Raising awareness through educational campaigns can help users understand the risks associated with infinite approvals and encourage safer interaction methods. Additionally, providing best practice guidelines for smart contract development and user interactions can significantly minimize risk exposure and enhance overall security.
Contents
Get updates on our community, partners, events, and everything happening across the ecosystem — delivered straight to your inbox.
Subscribe Now!
Office 104/105 Level 1, Emaar Square, Building 4 Sheikh Mohammed Bin Rashid Boulevard Downtown Dubai, United Arab Emirates P.O box: 416654
Privacy PolicyAll Rights Reserved. © 2025. QuillAudits - LLC
Office 104/105 Level 1, Emaar Square, Building 4 Sheikh Mohammed Bin Rashid Boulevard Downtown Dubai, United Arab Emirates P.O box: 416654
audits@quillaudits.comAll Rights Reserved. © 2025. QuillAudits - LLC
Privacy Policy