
Analysis of the Curio Exploit
Learn how Curio was exploited, which resulted in a loss of approximately $16 million.
Youtube Video
Playing the video that you've selected below in an iframe
After much deliberation and careful thought Neptune Mutual decided to close the cover marketplaces.
After much deliberation and careful thought Neptune Mutual decided to close the cover marketplaces. Below the reasons for the decision as well as what it means for the community.
The marketplaces will be closed using an emergency withdrawal process whereby the liquidity provided to cover pools by LPs will be returned to the wallet addresses from which the liquidity was supplied. In addition to protecting cover pool LPs, there will also be refunds to all cover policy purchasers with an existing and valid policy who have paid over 10 USD in policy fees in one transaction.
For veNPM holders, please fill out this form to receive a refund for your veNPM to NPM conversion penalty.
From the end of June there will no longer be NPM emission incentives for LPs i.e. Epoch 3 of the liquidity gauge emissions will be canceled.
Unused funds raised from financial backers will be returned to those backers; this includes DEX liquidity that has now been removed from SushiSwap and Uniswap. A small amount of liquidity on SushiSwap Arbitrum has been left to enable a minimum amount of NPM trading.
The protocol will be open sourced, and become a true public good. Enabling the community to fork the code developed by the Neptune Mutual team such that others might use the existing resources to further our mission to make the blockchain space better protected against smart contracts and other risks.
There are numerous factors that have led to this difficult decision, some of which are external factors which are uncontrollable or unforeseeable. A few factors summarized below:
“Given Neptune Mutual’s Tier 1 backers, why have you not listed on a top CEX?”
This is perhaps one of the most frequently asked questions. In short, the answer is that for a variety of reasons Neptune Mutual was not able to achieve the diverse set of performance metrics (community size and engagement, marketplace user activity, DEX 24 hour trading volume, TVL growth etc.) required to list on top tier CEX. The CEXs that are prepared to list NPM token do not have the depth of liquidity or breadth of user-base to offer good prospects for NPM tokenholders.
The above point invariably leads to the question
“Why has Neptune Mutual not achieved strong growth?”
It is tempting to take a shortcut to answer this question by pointing a finger at one specific factor, but the reality is that there are many contributing factors. A few summarized below:
Since the outset of engaging with the community we have endeavored to highlight the need for DeFiInsurance; Neptune Mutual built a comprehensive dataset of on-chain hacks available, anywhere, and each week we highlight the many millions of dollars that are stolen as a result of smart contract hacks. Despite this, we have consistently been confronted by projects unwilling to spin up cover pools in our marketplace because of the sentiment that audits of their code are sufficient to persuade their community that their protocol is safe. Less than 0.3% of all digital assets are protected with some form of DeFiInsurance, and yet despite all the media reports of hacks, the conference discussions about the importance of governance or CEX proof-of-reserves, it continues to be the case that it is extremely difficult to get media attention to focus on the need for a fast and efficient means of mitigating smart contract risk.
A variety of approaches have been taken by different DeFiInsurance protocols to address this, from attending multiple conferences throughout the year and significant marketing spend, to the leaner approach that Neptune Mutual took (in part as a result of the bear market in 2023). What can be said is that no DeFiInsurance protocol has managed to achieve significant growth over the last 18 months, sadly the overall TVL of the sector has shrunk a lot.
For all the reasons above, at this moment the best course of action is no longer to double-down on investing in growth, but rather to refund unused capital and close the marketplaces.
The consequences are very tough for the Neptune Mutual team who have spent the past 3 years of their time on the mission to facilitate safer environments within DeFi. The team has delivered products according to the roadmap and the fact that the protocol was never hacked, despite attempts being made on the darkweb, is testament to the expertise, passion and absolute focus on security. The team survived the FTX and UST crisis unscathed, and believed that the continued growth in hacks would lead to growth in the demand for a good solution to mitigate these risks, but sadly, as can be seen right across the DeFiInsurance category, this is not yet in sight. So we would like to thank the team for all the dedication, skill and passion invested into the Neptune Mutual project since the outset.
The team will open source the protocol, including blockchain indexing protocol (subgraph alternative), frontend, middleware, database, and backend code, to make it a true public good. This will allow anyone to fork the code and create covers by defining parameters and premium ranges, potentially leading to innovative covers and organic usage.
The Discord channel will be closed to reduce the risk of phishing and other types of cyber attack, any questions / queries will be responded to in the Telegram channel.
We want to take this final opportunity to thank you all for your support.
Neptune Mutual will contact only its financial backers, with whom a signed agreement exists, in relation to next steps (i.e. holding NPM tokens does not qualify you for any form of refund). Contact will be made only from a neptunemutual.com domain email address so please check the source of any email you may receive very carefully. Please ignore any messages from any other email or social media accounts in relation to token/cash refunds.
Learn how LeetSwap was exploited on the Base chain, resulting in a loss of $624,000.
On August 1, 2023, LeetSwap was exploited on the Base chain, which resulted in a loss of funds worth approximately $624,000.
LeetSwap is an emerging DEX and DeFi ecosystem built with a focus on retaining a secure, fast, and user-friendly experience.
The root cause of the exploit is due to the price manipulation caused by a vulnerable function that was incorrectly assigned a visibility specifier.
Step 1:
We attempt to analyze the attack transaction executed by the exploiter.
Step 2:
The LeetSwapV2Pair contract had a vulnerable `_transferFeesSupportingTaxTokens` function, which was mistakenly assigned a `public` visibility specifier. Therefore, anyone could invoke a call to this function in order to transfer tokens from the contract to the fee-collection address.
function _transferFeesSupportingTaxTokens(address token, uint256 amount) public returns (uint256) {
if (amount == 0) {
return 0;
}
uint256 balanceBefore = IERC20(token).balanceOf(fees);
_safeTransfer(token, fees, amount);
uint256 balanceAfter = IERC20(token).balanceOf(fees);
return balanceAfter - balanceBefore;
}
Step 3:
The attacker initially initiated a normal small-swap operation to acquire the necessary tokens for the next swap. They then invoked a call to this vulnerable function, thereby transferring all of the tokens from one of the pairs to the address collecting fees, which manipulated the price of the underlying token.
Step 4:
The exploiter then called the `sync` function to balance the `axlUSD/WETH` pool and performed a reverse swap to take more ETH than expected.
Step 5:
The attack was repeated on multiple pools, and the exploiter was able to drain funds worth 340 ETH, totaling approximately $624,000, from them.
The team acknowledged the occurrence of the incident and stated that they temporarily stopped trading to investigate the compromised liquidity. This was possible due to the presence of the pause functionality of the smart contracts. They also stated that they were working with on-chain security experts to try and find a way to recover the locked liquidity.
The team also worked to recover ETH from all the pools that were not drained by the attacker. They shared a Tweet for the attacker with hopes of entering into an agreement allowing them to retain 50 ETH and return the rest of the exploited funds back to the LeetSwap deployer.
Apparently, the team had their website down due to a DDoS attack on their servers, despite them being proxied and cached behind Claudflare. Approximately 220 ETH worth of stuck funds in the DEX liquidity pools have been recovered.
Given the unfortunate events that transpired with LeetSwap, it's essential to underscore the importance of not just prevention but also mitigation when it comes to decentralized finance and smart contract development.
The root of the exploit within LeetSwap's smart contract emanated from a seemingly minor oversight—incorrectly assigning a `public` visibility specifier. This kind of vulnerability underscores the criticality of meticulous smart contract design. While it's imperative for developers to ensure the appropriate visibility specifier for every function, these measures are only part of a holistic security approach.
Access control mechanisms are crucial. By using modifiers or implementing role-based access control, developers can significantly restrict unauthorized access to sensitive functions. Furthermore, it's beneficial to adopt an event-driven architecture, notifying external contracts or users of state changes rather than leaving potentially vulnerable data or functions exposed.
However, even with the most rigorous precautions in place, there's always a risk of unforeseen vulnerabilities. This is where Neptune Mutual would have proven invaluable for the LeetSwap team and its users.
Had LeetSwap established a dedicated cover pool with Neptune Mutual, the repercussions of this exploit could have been notably minimized. Neptune Mutual stands as a bastion for users against the often catastrophic consequences of smart contract vulnerabilities. We offer coverage to those who have unfortunately lost funds or digital assets due to such breaches. Our innovative approach, characterized by parametric policies, ensures a smooth and immediate payout system. With our coverage policies, users don't need to go through the cumbersome process of proving their losses. Once an incident is confirmed and resolved via Neptune Mutual's thorough incident resolution framework, affected users can claim their payouts instantaneously.
Moreover, Neptune Mutual's extensive marketplace presence, spanning across major blockchain networks such as Ethereum, Arbitrum, and the BNB chain, ensures a wide-reaching safety net for DeFi users. This accessibility not only provides protection against potential threats but also fosters strengthened trust in the decentralized finance ecosystem.
Reference Source SlowMist