OpenLeverage Lending Protocol Reentrancy Attack
Notice: This page is a freshly imported case study from the original repository. The original content was in a different format, and may not have relevant information for all sections. Please help restructure the content by moving information from the 'About' section to other sections, and add any missing information or sources you can find. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.
Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!
OpenLeverage was a permissionless lending margin trading protocol that facilitates borrowing and margin trading on decentralized exchanges (DEXs). Users could create lending and trading pools for any trading pair available on a DEX with default interest rates and risk parameters. However, the protocol experienced an attack, resulting in a loss of approximately $260,000. In response to the attack, OpenLeverage has decided to discontinue its trading and lending protocol and is initiating processes for users to safely close trades, borrowings, and withdraw funds. OpenLeverage has ensured that all protocol losses will be covered by in-protocol insurance, the OLE buyback fund, and protocol reserves, with no loss to user funds.
This is a global/international case not involving a specific country.[1][2][3][4][5][6][7][8][9]
About OpenLeverage
"Money Market with Possibilities With permissionless lending, borrowing, and margin trading, OpenLeverage enables borrow any asset, and long or short positions on any pairs on decentralized exchanges."
"OpenLeverage is a permissionless lending margin trading protocol that enables traders or other applications to long or short on any trading pair on DEXs efficiently and securely." "Anyone can create lending and trading pools for any trading pair available on a DEX, with default interest rate and risk parameters, in a single click."
"Margin trade thousands of tokens with best prices from 1inch, Uniswap, PancakeSwap, Sushiswap, and borrow with 90% reduced rate than other platforms." "[P]ledge any token as collateral, and borrow another token in a token pair as long as sufficient liquidity provided." "Isolated and independent lending pools facilitate single-sided token lending with minimal risk. Margin interest incurred by borrower is paid out to lenders." "Deployed to Ethereum, BNB Chain, Arbitrum, and Kucoin Community Chain, and empowering more EVM-compatible chains soon."
"The DeFi protocol OpenLeverage has been attacked, resulting in a loss of approximately $260,000. In light of this, OpenLeverage has decided to discontinue the OpenLeverage trading and lending protocol. OpenLeverage is initiating processes for users to close trades/borrowings and withdraw funds safely. All protocol actions will remain paused until withdrawal processes begin early next week."
"The hack involved a two-step attack strategy, each consisting of two transactions. In the first transaction, the attacker initiated a margin trade and a small borrow position, then proceeded to liquidate it. However, the liquidation process was flawed, as it incorrectly accounted for borrow amounts from both the “borrow” function and margin trading. Additionally, the attacker exploited the “repayBorrowEndByOpenLev” function within the liquidation process, allowing them to close the borrow position with minimal repayment. In the second transaction, the attacker withdrew tokens using the “payoffTrade” function without making any repayment, leveraging the absence of a borrowed amount from the preceding transaction. To circumvent time constraints, the attacker split their actions into two separate transactions due to a block time check."
"- The recent exploit caused a loss of ~220k on BNB Chain & ~40k on Arbitrum. - Thankfully, our in-protocol insurance, OLE buyback fund, and protocol reserves will cover all protocol losses. - So, NO user funds will be lost."
"In light of this, we've made the tough decision to discontinue the OpenLeverage trading and lending protocol.
We're initiating processes for users to close trades/borrowings & withdraw funds safely."
"All protocol actions remain paused until withdrawal processes start about early next week.
Your support & patience mean the world to us. Stay tuned for updates."
"The hacker will receive a bounty to return funds, and the trace and legal process will start immediately."
"We’ve enabled fund withdrawals for the lenders. All margin trades and borrow positions are required to close manually before the borrowing rate hike to 2000% annualized from Monday."
This is a global/international case not involving a specific country.
The background of the exchange platform, service, or individuals involved, as it would have been seen or understood at the time of the events.
Include:
- Known history of when and how the service was started.
- What problems does the company or service claim to solve?
- What marketing materials were used by the firm or business?
- Audits performed, and excerpts that may have been included.
- Business registration documents shown (fake or legitimate).
- How were people recruited to participate?
- Public warnings and announcements prior to the event.
Don't Include:
- Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed.
- Anything that wasn't reasonably knowable at the time of the event.
There could be more than one section here. If the same platform is involved with multiple incidents, then it can be linked to a main article page.
The Reality
This sections is included if a case involved deception or information that was unknown at the time. Examples include:
- When the service was actually started (if different than the "official story").
- Who actually ran a service and their own personal history.
- How the service was structured behind the scenes. (For example, there was no "trading bot".)
- Details of what audits reported and how vulnerabilities were missed during auditing.
What Happened
The specific events of the loss and how it came about. What actually happened to cause the loss and some of the events leading up to it.
| Date | Event | Description |
|---|---|---|
| March 31st, 2024 11:19:41 PM MDT | Blockchain Transaction | The actual attack transaction occurs on the Binance Smart Chain. |
| March 31st, 2024 11:41:00 PM MDT | PeckShield Posts Exploit | PeckShield posts details of the exploit against the smart contract including the transaction. |
| April 1st, 2024 12:13:00 AM MDT | Contract Paused | A tweet notes that the contract is paused while an investigation is underway. |
| April 1st, 2024 3:45:00 AM MDT | Twitter Post | A tweet is posted about the exploit and resulting loss. |
| April 14th, 2024 9:21:00 AM MDT | Request For More Time | The team posts an update to Twitter requesting more time to enable the withdrawals system. |
| April 19th, 2024 5:51:00 AM MDT | Withdrawals Opened | The system has withdrawals open and trading/borrowing closed. |
| April 22nd, 2024 7:25:00 AM MDT | Extreme Interest Rates | The system interest rates are set to 2000% to force users to close positions before liquidation is enforced. |
Technical Details
This section includes specific detailed technical analysis of any security breaches which happened. What specific software vulnerabilities contributed to the problem and how were they exploited?
Total Amount Lost
The total amount lost has been estimated at $260,000 USD.
How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?
Immediate Reactions
How did the various parties involved (firm, platform, management, and/or affected individual(s)) deal with the events? Were services shut down? Were announcements made? Were groups formed?
Ultimate Outcome
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
Total Amount Recovered
There do not appear to have been any funds recovered in this case.
What funds were recovered? What funds were reimbursed for those affected users?
Ongoing Developments
What parts of this case are still remaining to be concluded?
Individual Prevention Policies
No specific policies for individual prevention have yet been identified in this case.
For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.
Platform Prevention Policies
Policies for platforms to take to prevent this situation have not yet been selected in this case.
For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.
Regulatory Prevention Policies
No specific regulatory policies have yet been identified in this case.
For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.
References
- ↑ SlowMist Hacked - SlowMist Zone (Apr 26, 2024)
- ↑ @OpenLeverage Twitter (Apr 30, 2024)
- ↑ OpenLeverage (Apr 30, 2024)
- ↑ Introduction of OpenLeverage | OpenLeverage | Docs (Apr 30, 2024)
- ↑ @OpenLeverage Twitter (Apr 30, 2024)
- ↑ BNB Smart Chain Transaction Hash (Txhash) Details | BscScan (Apr 30, 2024)
- ↑ @OpenLeverage Twitter (Apr 30, 2024)
- ↑ @OpenLeverage Twitter (Apr 30, 2024)
- ↑ OpenLeverage Hack Analysis. Overview: | by Shashank | Apr, 2024 | SolidityScan (Apr 30, 2024)