On July 21, Defi Conic Finance suffered two significant exploits due to vulnerabilities in its smart contracts. These vulnerabilities led to a total loss of approximately $4.2M from its ETH and crvUSD omnipools.
The first exploit, amounting to a loss of ~$3.3M from the ETH pool, was attributed to a read-only reentrancy flaw in the Oracle contract.
The second exploit, leading to a loss of ~$934K from the crvUSD Omnipool, was a sandwich attack on imbalanced pools. These breaches had dire consequences on Conic’s reputation, causing a significant drop in the value of its native token, CNC.
What is Conic Finance?
Table of Contents
- 1 What is Conic Finance?
- 2 Hack Analysis
- 3 What is Reentrancy Vulnerability?
- 4 Important Links:
- 5 crvUSD Omnipool Exploit
- 6 What are sandwich attacks?
- 7 Repercussions
- 8 Conclusion
Conic Finance is a liquidity pool platform designed for the Curve DeFi protocol. With its base in Milan and founded in 2022, it primarily aims to balance liquidity in the decentralized finance sector.
Conic Finance allows users to efficiently trade, swap assets, and provide liquidity to multiple Curve pools through a single transaction, using the Conic Omnipool.
This feature permits users to diversify their investments across various assets, leading to potentially higher returns.
ETH Omnipool Exploit: Timeline and Impact:
Time: 10:51 am UTC
Loss: Around $3.2 million worth of WETH.
Mechanism and Attack Steps
The attacker leveraged a read-only reentrancy vulnerability in the Oracle contract. Here’s a detailed step-by-step breakdown:
- The hacker delved deep into Conic ETH Omnipool mechanisms and discovered a vulnerability in ETH presence determination.
- Identified a mismatch in the
_isETHmethod used by Omnipool.
- Realized that instead of the expected ETH address (0xeee…eee), these pools used the WETH address.
- The reentrancy guard for the rETH pool was bypassed due to this mismatch.
- Exploited this flaw to manipulate the rETH Curve LP token’s price.
- Using the manipulated price, the attacker hoodwinked the ETH Omnipool into minting excessive cncETH LP tokens.
- Ran a deposit-withdrawal loop, capitalizing on the manipulated prices, draining the pool by approximately $3.2 million.
- The Curve pool has a flaw where it allows an attacker to interfere while it’s only halfway through updating its internal data. So when Conic checks the data from Curve, it receives incorrect information.
- After messing with the Curve pool’s data, the attacker then requests a withdrawal from Conic. Because Conic relies on the now-corrupted data from Curve to determine how much to give, it ends up giving out the wrong amount.
- So, when Conic tries to check the value of its tokens by looking at the Curve pool (which is now showing wrong data because of the attacker), it gets deceived.
What is Reentrancy Vulnerability?
A reentrancy vulnerability in smart contracts, particularly in the Ethereum context, occurs when an external contract is able to call back into the calling contract before the first function call is finished.
This can allow the external contract to exploit the calling contract, especially in cases where the calling contract’s state (e.g., balances) isn’t updated until after external calls.
The infamous DAO hack in Ethereum was a result of such a vulnerability, where the attacker was able to repeatedly withdraw funds due to the contract’s state not being updated in time. You can read more about Reentrancy Vulnerability at https://www.immunebytes.com/blog/reentrancy-attack/
crvUSD Omnipool Exploit
Time: Started at 19:08 UTC
Loss: Approximately $934,000, leading to a profit of around $300,000 for the attacker.
Mechanism and Attack Steps
The attacker leveraged a type of sandwich attack on imbalanced pools, taking advantage of the favorable exchange rates in the Curve pool.
Though Conic Finance had mechanisms to prevent interactions with imbalanced Curve pools, the set bounds were too lenient, allowing the attacker to siphon funds gradually.
- Exchange crvUSD to USDC in the Curve pool.
- Deposit crvUSD into Conic.
- Exchange USDC to crvUSD in the Curve pool.
- Withdraw from Conic.
Transactions attacking the crvUSD pool:
A comprehensive list of transaction hashes is provided, all of which can be inspected on Etherscan for further detail.
Most of the stolen were either moved to different addresses or deposited to Tornado.cash.
What are sandwich attacks?
A sandwich attack, in the context of decentralized exchanges (DEXes) and DeFi, is a type of front-running attack where a malicious actor observes a pending transaction from a user and places two transactions of their own: one before (front-run) and one after (back-run) the user’s transaction.
The aim is to capitalize on price slippages, liquidity pool changes, or other trade impacts that the user’s transaction will create. Essentially, the attacker “sandwiches” the user’s transaction with their own, thereby profiting at the user’s expense.
- Conic’s native token, CNC, experienced a dramatic decline in value post-hack. Before the initial breach, CNC’s price hovered around $6. However, it plummeted by 35% after the first exploit and eventually dropped to $1.72 after the second.
At the time of this report, CNC’s value has stabilized at approximately $2.75, which is just below half of its pre-hack price.
- Conic’s prior standing as a highly anticipated DeFi project, with the potential to compete with giants like CVX/Yearn, has undoubtedly been shaken.
The exploits faced by Conic Finance are a somber reminder of the risks inherent to the DeFi sector. It underscores the importance of robust security audits, continuous monitoring, and swift response mechanisms.
As the space continues to evolve, it is crucial for both projects and users to prioritize security and stay informed about potential vulnerabilities.