Cover Protocol Hack: Difference between revisions

From Quadriga Initiative Cryptocurrency Hacks, Scams, and Frauds Repository
Jump to navigation Jump to search
No edit summary
(Added more sources.)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/coverprotocolhack.php}}
{{Imported Case Study 2|source=https://www.quadrigainitiative.com/casestudy/coverprotocolhack.php}}
{{Unattributed Citations}}
{{Unattributed Sources}}


[[File:Coverprotocol.jpg|thumb|Cover Protocol]]Cover protocol is a market for insurance, allowing you to protect your assets on other platforms against loss.
[[File:Coverprotocol.jpg|thumb|Cover Protocol]]Cover protocol is a market for insurance, allowing you to protect your assets on other platforms against loss.
Line 6: Line 6:
Except that the protocol itself got hacked, and there was nobody to insure it. Luckily, the firm which had conducted the breach owned up to it and gave the money back.
Except that the protocol itself got hacked, and there was nobody to insure it. Luckily, the firm which had conducted the breach owned up to it and gave the money back.


This is a global/international case not involving a specific country.
This is a global/international case not involving a specific country.<ref name="rekt-513" /><ref name="rektnews-691" /><ref name="coindesk-692" /><ref name="coinmarketcap-693" /><ref name="coverprotocoltwitter-694" /><ref name="cryptobriefing-695" /><ref name="coverprotocol-696" /><ref name="coingape-697" /><ref name="sassal0xtwitter-698" /><ref name="coingape-699" /><ref name="chainbulletin-700" /><ref name="coingape-701" /><ref name="crywnews-702" /><ref name="grapfinancetwitter-703" /><ref name="cryptonary-704" /><ref name="messari-705" /><ref name="ciphertrace-1152" /><ref name="slowmisthacked-678" /><ref name="certik-1776" /><ref name="cryptosec-5385" /><ref name="theblockcrypto-5422" /><ref name="guronghuierictwitter-5462" />
<ref name="rekt-513" /><ref name="rektnews-691" /><ref name="coindesk-692" /><ref name="coinmarketcap-693" /><ref name="coverprotocoltwitter-694" /><ref name="cryptobriefing-695" /><ref name="coverprotocol-696" /><ref name="coingape-697" /><ref name="sassal0xtwitter-698" /><ref name="coingape-699" /><ref name="chainbulletin-700" /><ref name="coingape-701" /><ref name="crywnews-702" /><ref name="grapfinancetwitter-703" /><ref name="cryptonary-704" /><ref name="messari-705" /><ref name="ciphertrace-1152" /><ref name="slowmisthacked-678" /><ref name="certik-1776" /><ref name="cryptosec-5385" /><ref name="theblockcrypto-5422" /><ref name="guronghuierictwitter-5462" /><ref name="certikiotwitter-5463" /><ref name="certikorgtwitter-5464" /><ref name="amanusktwitter-8743" />


== About Cover Protocol ==
== About Cover Protocol ==
Line 63: Line 62:
!Description
!Description
|-
|-
|December 28th, 2020 12:00:00 AM
|December 28th, 2020
|Main Event
|Main Event
|Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here.
|Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here.
|-
|-
|
|December 28th, 2020 6:08:00 AM MST
|
|Tokens Reported Burned
|
|Twitter user banteg reports that the "The biggest exploiter has burned the tokens after cashing out 4374 ether ($3.2 million)."<ref>[https://twitter.com/bantg/status/1343544473305886721 banteg - "The biggest exploiter has burned the tokens after cashing out 4374 ether ($3.2 million)." - Twitter] (Nov 3, 2023)</ref>
|-
|December 28th, 2020 6:41:01 AM MST
|Funds Returned
|Funds exploited are reportedly returned, with a comment to "Next time, take care of your own [stuff]"<ref name=":0">[https://etherscan.io/tx/0xc2fd5094c1e108f83222a86bd46b35fc0da35616385d681964b22003643f982e Transaction Returning 4,350 ETH to Cover Protocol - Etherscan]  (Nov 3, 2023)</ref><ref name="amanusktwitter-8743" />.
|-
|December 28th, 2020 8:47:00 AM MST
|CertiK Announces Exploit and Return
|CertiK announced the exploit and that all funds were returned<ref name="certikorgtwitter-5464" />.
|-
|December 28th, 2020 5:10:37 PM MST
|CertiK Publishes Incident Analysis
|CertiK publishes an analysis of the incident by their "leading security engineers" on Twitter<ref name=":1">[https://medium.com/shentu-foundation/cover-tokens-vulnerability-analysis-b692d0d2fc28 Shentu Foundation - Cover Token’s Vulnerability Analysis - Medium] (Nov 3, 2023)</ref><ref>[https://twitter.com/CertiKCommunity/status/1343720717377024000 CertiK Community - "A summary of the $COVER vulnerability exploit. There's still a lot to the story but here's an analysis from leading security engineers" - Twitter] (Nov 3, 2023)</ref><ref name="certikiotwitter-5463" />.
|}
|}


== Total Amount Lost ==
== Technical Details ==
The total amount lost has been estimated at $9,400,000 USD.
On December 28th, 2020, there was an attack on the Cover token, involving an infinite minting vulnerability<ref name=":1" />. The attacker exploited this vulnerability by repeatedly staking, unstaking, and claiming through the project's contract, leading to the unlimited minting of coins and a collapse in Cover token prices. The attack involved various functions within the project's contracts, including deposit(), updatePool(), and _claimCoverRewards()<ref name=":1" />. The vulnerability allowed the attacker to gain a significant number of COVER tokens. After the attack, Cover officials migrated the blacksmith contract to a secure version to prevent further exploitation<ref name=":1" />. Several hackers took advantage of this vulnerability, with one making around $4.4 million. Grap.Finance, another attacker, returned the funds via its Twitter account. CertiK is a leading audit company that performs security audits and protects crypto assets, offering CertiKShield for loss reimbursement due to hacks or exploits<ref name=":1" />.


How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?
<ref name=":0" />


== Immediate Reactions ==
Grap Finance Exploiting: <ref>[https://etherscan.io/address/0x00007569643bc1709561ec2e86f385df3759e5dd Grap Finance Transaction History - Etherscan] (Nov 3, 2023)</ref>
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 ==
=== CertiK Technical Analysis ===
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
CertiK published a technical analysis<ref name=":1" />.<blockquote>The attacker staked the Balancer lp tokens to the Blacksmith.sol contract in Cover Protocol.


== Total Amount Recovered ==
The deposit() function shown in Figure 1 is invoked in the process of staking.
The total amount recovered has been estimated at $3,696,000 USD.


What funds were recovered? What funds were reimbursed for those affected users?
By invoking the deposit function, the attacker staked BPT and received LP tokens via the cover protocol. In line 118, the contract loads and holds the pool data in the memory by a given LP token. Later, it updates the pool data by invoking updatePool function shown in line 121 in figure 2.


== Ongoing Developments ==
Please note that the pool data which is stored in line 118 of figure 1 is in the Memory location of smart contract whereas the pool data stored in line 75 of figure 2 is in Storage location of smart contract. The difference is: Memory in Solidity is a temporary place to store data whereas Storage holds data between function calls. The value of lpTotal in line 84 represents the total number of liquidity proof tokens deposited in the current contract. Since the value of lpTotal is small, the value of pool.accRewardsPerToken will increase through the formula on line 84, and the updated pool.accRewardsPerToken is stored in Storage, which will not affect the value stored in the Memory in this case.
What parts of this case are still remaining to be concluded?


== Prevention Policies ==
Next, deposit() calls the _claimCoverRewards() function, as shown in line 318 in Figure 3. This specific contract minted COVER tokens with the amount of minedSinceLastUpdate for the function caller (msg.sender). The formula to calculate the number of COVER tokens that was going to be minted is shown in line 316 in Figure 3. It is controlled by the value of the three variables — — pool.accRewardsPerToken, CAL_MULTIPLIER and miner.rewardWriteoff. The value of pool.accRewardsPerToken is adopted from Memory rather than from Storage which is updated in the update() function.
The decentralized finance space is still new and developing.


It is essentially impossible to prove that a smart contract is secure. More secure storage of funds involve multi-signature offline storage.
We can also observe that the value of miner.rewardWriteoff is updated in line 130 in Figure 1, which occurs after invocation of the _claimCoverRewards() function shown in Figure 3. The updated miner.rewardWriteoff value should have been used to calculate the amount of COVER tokens that needs to be minted. However, the formula in line 316 in Figure 3 used the smaller miner.rewardWriteoff value that has not been updated, which as the result minted more COVER tokens than it should be.


== References ==
After staking, the attacker calls the withdraw() function in the blacksmith.sol contract to retrieve the staked BPT, and get the minted COVER tokens as rewards.
<references><ref name="rekt-513">[https://rekt.news/leaderboard/ Rekt - Leaderboard] (May 12, 2021)</ref>


<ref name="rektnews-691">[https://rekt.news/cover-rekt/ Rekt - Cover - REKT] (May 15, 2021)</ref>
By comparing the token balance table after the deposit() and the withdraw() execution, the attacker gained 704 COVER tokens.


<ref name="coindesk-692">[https://www.coindesk.com/cover-protocol-attack-perpetrated-by-white-hat-all-funds-returned-hacker-claimsa Cover Protocol Attack Perpetrated by White-Hat - All Funds Returned, Hacker Claims] (May 17, 2021)</ref>
The attacker profits by using this loophole, repeatedly executing the deposit and withdraw functions to infinitely mint tokens, and transfer the hacked tokens to their own address.</blockquote>


<ref name="coinmarketcap-693">[https://coinmarketcap.com/headlines/news/cover-hack-cover-protocol-binance-compensation-plan-hack-victim/ COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims | Headlines | News | CoinMarketCap] (May 17, 2021)</ref>
== Total Amount Lost ==
The total amount lost has been estimated at $9,400,000 USD.


<ref name="coverprotocoltwitter-694">[https://twitter.com/CoverProtocol/status/1343581331448586245 @CoverProtocol Twitter] (May 17, 2021)</ref>
== 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?


<ref name="cryptobriefing-695">[https://cryptobriefing.com/cover-protocol-hacker-million-binance-halts-token-trading/ Cover Protocol Hacker Makes Off With Millions, Binance Halts Token Trading | Crypto Briefing] (May 17, 2021)</ref>


<ref name="coverprotocol-696">[https://www.coverprotocol.com/ Cover Protocol] (May 17, 2021)</ref>
"$COVER is exploited to the max."


<ref name="coingape-697">[https://coingape.com/cover-hack-cover-protocol-binance-compensation-plan-hack-victim/ COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims] (May 17, 2021)</ref>
"Extremely high weight and rewards per token. Something went terribly wrong in the Cover contract."


<ref name="sassal0xtwitter-698">[https://twitter.com/sassal0x/status/1343554690181566464 @sassal0x Twitter] (May 17, 2021)</ref>
<nowiki>https://twitter.com/apedeveloper/status/1343529821054382081|Jan</nowiki> 3, 2023


<ref name="coingape-699">[https://coingape.com/cover-becomes-latest-defi-protocol-to-get-exploited-price-crashes-by-77-within-an-hour/ Breaking: Hyped Defi Project COVER Protocol Exploited, Hacker Mints Unlimited COVER Token] (May 17, 2021)</ref>
<nowiki>https://web.archive.org/web/20201228121121/https://twitter.com/apedeveloper/status/1343529821054382081|Nov</nowiki> 3, 2023


<ref name="chainbulletin-700">[https://chainbulletin.com/hacker-returns-stolen-funds-to-cover-protocol/ Hacker Returns Stolen Funds to Cover Protocol - The Chain Bulletin] (May 17, 2021)</ref>
<nowiki>https://twitter.com/apedeveloper/status/1343533660088246272|Nov</nowiki> 3, 2023


<ref name="coingape-701">[https://coingape.com/cover-protocol-exploit-takes-a-bizzare-turn-hacker-returns-all-the-funds-with-an-important-message/ Cover Protocol Exploit Takes a Bizzare Turn, Hacker Returns All The Funds With an Important Message] (May 17, 2021)</ref>
<nowiki>https://web.archive.org/web/20201228122625/https://twitter.com/apedeveloper/status/1343533660088246272|Nov</nowiki> 3, 2023


<ref name="crywnews-702">[https://crywnews.com/altcoins/cover-hack-cover-protocol-and-binance-announce-compensation-plan-for-hack-victims/ COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims - Crypto World News] (May 17, 2021)</ref>
=== Twitter Reactions ===
<ref>[https://twitter.com/darkforest_lian/status/1343555297202348034 darkforest_lian - "first SAFE, then SAFE2, after that SAFE3, finally COVER, OH  NO! IT'S NOT OVER YET! what's their next name?" - Twitter] (Nov 3, 2023)</ref><blockquote>first SAFE, then SAFE2, after that SAFE3, finally COVER, OH  NO! IT'S NOT OVER YET! what's their next name?</blockquote>


<ref name="grapfinancetwitter-703">[https://twitter.com/GrapFinance/status/1343555258316804101 @GrapFinance Twitter] (May 18, 2021)</ref>
== Ultimate Outcome ==
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?


<ref name="cryptonary-704">[https://www.cryptonary.com/attacker-mints-more-than-1-quintillion-tokens-in-defi-cover-protocol-hack/ Attacker mints more than 1 quintillion tokens in DeFi Cover Protocol hack | Cryptonary] (May 18, 2021)</ref>
== Total Amount Recovered ==
The total amount recovered has been estimated at $3,696,000 USD.


<ref name="messari-705">[https://messari.io/asset/cover-protocol/profile Messari - Bitcoin & crypto price, news, charts, and research] (May 18, 2021)</ref>
Returning Funds Transaction: <ref name=":0" />


<ref name="ciphertrace-1152">[https://ciphertrace.com/wp-content/uploads/2021/01/CipherTrace-Cryptocurrency-Crime-and-Anti-Money-Laundering-Report-012821.pdf CipherTrace Cryptocurrency Crime and Anti-Money Laundering Report 2020] (Jun 19, 2021)</ref>
== Ongoing Developments ==
What parts of this case are still remaining to be concluded?
== General Prevention Policies ==
The decentralized finance space is still new and developing.


<ref name="slowmisthacked-678">[https://hacked.slowmist.io/en/?c=ETH%20DApp SlowMist Hacked - SlowMist Zone] (May 17, 2021)</ref>
It is essentially impossible to prove that a smart contract is secure. More secure storage of funds involve multi-signature offline storage.
 
== Individual Prevention Policies ==
<ref name="certik-1776">[https://www.certik.org/blog/blockchain-hacks-2020-15-billion-lost-how-can-we-mitigate-hacks-in-2021 Blockchain Hacks: 2020 | $15 billion lost, how can we mitigate hacks in 2021? | CertiK Foundation Blog] (Jul 22, 2021)</ref>
{{Prevention:Individuals:Placeholder}}


<ref name="cryptosec-5385">[https://cryptosec.info/defi-hacks/ Comprehensive List of DeFi Hacks & Exploits - CryptoSec] (Jan 8, 2022)</ref>
{{Prevention:Individuals:End}}


<ref name="theblockcrypto-5422">[https://www.theblockcrypto.com/post/89368/defi-protocol-cover-exploited-attackers-minted-at-least-40-quintillion-tokens DeFi protocol Cover exploited, attackers minted at least 40 quintillion tokens] (Jan 9, 2022)</ref>
== Platform Prevention Policies ==
{{Prevention:Platforms:Placeholder}}


<ref name="guronghuierictwitter-5462">[https://mobile.twitter.com/guronghuieric/status/1343672295857016832 https://mobile.twitter.com/guronghuieric/status/1343672295857016832] (Jan 10, 2022)</ref>
{{Prevention:Platforms:End}}


<ref name="certikiotwitter-5463">[https://mobile.twitter.com/certik_io/status/1343730470962536448 https://mobile.twitter.com/certik_io/status/1343730470962536448] (Jan 10, 2022)</ref>
== Regulatory Prevention Policies ==
{{Prevention:Regulators:Placeholder}}


<ref name="certikorgtwitter-5464">[https://mobile.twitter.com/certikorg/status/1343584463171825664 https://mobile.twitter.com/certikorg/status/1343584463171825664] (Jan 10, 2022)</ref>
{{Prevention:Regulators:End}}


<ref name="amanusktwitter-8743">[https://twitter.com/amanusk_/status/1343554855261138944 @amanusk_ Twitter] (Jul 24, 2022)</ref></references>
== References ==
<references>
<ref name="rekt-513">[https://rekt.news/leaderboard/ Rekt - Leaderboard] (May 13, 2021)</ref>
<ref name="rektnews-691">[https://rekt.news/cover-rekt/ Rekt - Cover - REKT] (May 16, 2021)</ref>
<ref name="coindesk-692">[https://www.coindesk.com/cover-protocol-attack-perpetrated-by-white-hat-all-funds-returned-hacker-claimsa Cover Protocol Attack Perpetrated by White-Hat - All Funds Returned, Hacker Claims] (May 18, 2021)</ref>
<ref name="coinmarketcap-693">[https://coinmarketcap.com/headlines/news/cover-hack-cover-protocol-binance-compensation-plan-hack-victim/ COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims | Headlines | News | CoinMarketCap] (May 18, 2021)</ref>
<ref name="coverprotocoltwitter-694">[https://twitter.com/CoverProtocol/status/1343581331448586245 @CoverProtocol Twitter] (May 18, 2021)</ref>
<ref name="cryptobriefing-695">[https://cryptobriefing.com/cover-protocol-hacker-million-binance-halts-token-trading/ Cover Protocol Hacker Makes Off With Millions, Binance Halts Token Trading | Crypto Briefing] (May 18, 2021)</ref>
<ref name="coverprotocol-696">[https://www.coverprotocol.com/ Cover Protocol] (May 18, 2021)</ref>
<ref name="coingape-697">[https://coingape.com/cover-hack-cover-protocol-binance-compensation-plan-hack-victim/ COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims] (May 18, 2021)</ref>
<ref name="sassal0xtwitter-698">[https://twitter.com/sassal0x/status/1343554690181566464 @sassal0x Twitter] (May 18, 2021)</ref>
<ref name="coingape-699">[https://coingape.com/cover-becomes-latest-defi-protocol-to-get-exploited-price-crashes-by-77-within-an-hour/ Breaking: Hyped Defi Project COVER Protocol Exploited, Hacker Mints Unlimited COVER Token] (May 18, 2021)</ref>
<ref name="chainbulletin-700">[https://chainbulletin.com/hacker-returns-stolen-funds-to-cover-protocol/ Hacker Returns Stolen Funds to Cover Protocol - The Chain Bulletin] (May 18, 2021)</ref>
<ref name="coingape-701">[https://coingape.com/cover-protocol-exploit-takes-a-bizzare-turn-hacker-returns-all-the-funds-with-an-important-message/ Cover Protocol Exploit Takes a Bizzare Turn, Hacker Returns All The Funds With an Important Message] (May 18, 2021)</ref>
<ref name="crywnews-702">[https://crywnews.com/altcoins/cover-hack-cover-protocol-and-binance-announce-compensation-plan-for-hack-victims/ COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims - Crypto World News] (May 18, 2021)</ref>
<ref name="grapfinancetwitter-703">[https://twitter.com/GrapFinance/status/1343555258316804101 @GrapFinance Twitter] (May 19, 2021)</ref>
<ref name="cryptonary-704">[https://www.cryptonary.com/attacker-mints-more-than-1-quintillion-tokens-in-defi-cover-protocol-hack/ Attacker mints more than 1 quintillion tokens in DeFi Cover Protocol hack | Cryptonary] (May 19, 2021)</ref>
<ref name="messari-705">[https://messari.io/asset/cover-protocol/profile Messari - Bitcoin & crypto price, news, charts, and research] (May 19, 2021)</ref>
<ref name="ciphertrace-1152">[https://ciphertrace.com/wp-content/uploads/2021/01/CipherTrace-Cryptocurrency-Crime-and-Anti-Money-Laundering-Report-012821.pdf CipherTrace Cryptocurrency Crime and Anti-Money Laundering Report 2020] (Jun 20, 2021)</ref>
<ref name="slowmisthacked-678">[https://hacked.slowmist.io/en/?c=ETH%20DApp SlowMist Hacked - SlowMist Zone] (May 18, 2021)</ref>
<ref name="certik-1776">[https://www.certik.org/blog/blockchain-hacks-2020-15-billion-lost-how-can-we-mitigate-hacks-in-2021 Blockchain Hacks: 2020 | $15 billion lost, how can we mitigate hacks in 2021? | CertiK Foundation Blog] (Jul 23, 2021)</ref>
<ref name="cryptosec-5385">[https://cryptosec.info/defi-hacks/ Comprehensive List of DeFi Hacks & Exploits - CryptoSec] (Jan 8, 2022)</ref>
<ref name="theblockcrypto-5422">[https://www.theblockcrypto.com/post/89368/defi-protocol-cover-exploited-attackers-minted-at-least-40-quintillion-tokens DeFi protocol Cover exploited, attackers minted at least 40 quintillion tokens] (Jan 9, 2022)</ref>
<ref name="guronghuierictwitter-5462">https://mobile.twitter.com/guronghuieric/status/1343672295857016832 (Jan 10, 2022)</ref>
<ref name="certikiotwitter-5463">[https://twitter.com/CertiK/status/1343730470962536448 CertiK - "A summary of the $COVER vulnerability exploit!" - Twitter] (Jan 10, 2022)</ref>
<ref name="certikorgtwitter-5464">[https://twitter.com/CertiKCommunity/status/1343584463171825664 Certik - "Unfortunately it looks like the $COVER token was exploited today. All funds were returned but they exposed a vulnerability." - Twitter] (Jan 10, 2022)</ref>
<ref name="amanusktwitter-8743">[https://twitter.com/amanusk_/status/1343554855261138944 amanusk_ - "This service is free! (to watch, not to use)" - Twitter] (Jul 24, 2022)</ref>
</references>

Latest revision as of 13:21, 3 November 2023

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' and 'General Prevention' sections 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!

Cover Protocol

Cover protocol is a market for insurance, allowing you to protect your assets on other platforms against loss.

Except that the protocol itself got hacked, and there was nobody to insure it. Luckily, the firm which had conducted the breach owned up to it and gave the money back.

This is a global/international case not involving a specific country.[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20][21][22]

About Cover Protocol

Cover is "A peer-to-peer coverage market - A platform where you can buy coverage on anything." "COVER Protocol allows DeFi users to protect against smart contract risk. It stabilizes the turbulent DeFi space by instilling confidence and trust between protocols and their users. At the core of Cover Protocol are the fungible cover tokens. Fungible cover tokens are created when a user deposits collateral into a Cover smart contract. Each Cover contract specifies the protocol to be covered (ie Curve), the preferred collateral (ie DAI), the amount to deposit, and then the expiration date of coverage."

"The decentralized finance (DeFi) insurance project Cover Protocol was hacked earlier Monday in an infinite printing scheme, causing the price of the COVER token to plunge. Hours later, Grap.Finance, a “white hat hacker” claimed responsibility for the attack via their Twitter account, saying all funds had been returned."

"A hacker has exploited a bug in the incentives smart contract of Cover Protocol. This has allowed the hacker to get away with 11,761 COVER tokens, worth $3.62 million at press time."

"COVER (formerly known as SAFE) fell ~90% when an infinite mint loophole was uncovered and exploited, causing the total supply of tokens to increase by 48 quadrillion percent, from 84,477 to 40,796,131,214,802,600,000."

"The attackers managed to exploit a bug in the Cover’s incentive contract called infinite mining bug’." "They successfully discovered a process that gave them COVER tokens as rewards. They then staked, unstaked, and restaked LP tokens in rapid succession." "Nansen, an analyst group focused on Ethereum wallets revealed that the exploiter managed to carry on his exploits for over 2 hours and all of the $2 million stolen funds were minted token."

"Banteg, Yearn Finance’s core developer, commented on Twitter, saying that they are investigating the issue. Yearn Finance entered into a merger with Cover protocol on Nov.28. Binance has halted trading and deposits of Cover Protocol as well."

"“The 4350 ETH that has been returned by the attacker will also be handled through a snapshot to the LP token holders. We are still investigating,” according to the project’s Twitter account." "After claiming responsibility for the hack, the attacker sent a message telling Cover Protocol to “take care of your own shit.”"

"The Cover protocol has now come up with a compensation plan to refurbish those who were impacted by the exploit a couple of days ago. The team behind the defi insurance protocol released a medium post informing traders that the refurbishment plans would be based on the snapshot of block 11541218 which is the block before the first exploit took place."

"We will use the snapshot to calculate each user’s ownership percentage of all outstanding COVER-ETH LP tokens and distribute the ETH proportionally. We have received a total of 4,441.8 (4,350 + 1 + 90.8) ETH. The final distribution will be the total amount of ETH returned by exploiters to the dev multi-sig."

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.

Key Event Timeline - Cover Protocol Hack
Date Event Description
December 28th, 2020 Main Event Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here.
December 28th, 2020 6:08:00 AM MST Tokens Reported Burned Twitter user banteg reports that the "The biggest exploiter has burned the tokens after cashing out 4374 ether ($3.2 million)."[23]
December 28th, 2020 6:41:01 AM MST Funds Returned Funds exploited are reportedly returned, with a comment to "Next time, take care of your own [stuff]"[24][25].
December 28th, 2020 8:47:00 AM MST CertiK Announces Exploit and Return CertiK announced the exploit and that all funds were returned[26].
December 28th, 2020 5:10:37 PM MST CertiK Publishes Incident Analysis CertiK publishes an analysis of the incident by their "leading security engineers" on Twitter[27][28][29].

Technical Details

On December 28th, 2020, there was an attack on the Cover token, involving an infinite minting vulnerability[27]. The attacker exploited this vulnerability by repeatedly staking, unstaking, and claiming through the project's contract, leading to the unlimited minting of coins and a collapse in Cover token prices. The attack involved various functions within the project's contracts, including deposit(), updatePool(), and _claimCoverRewards()[27]. The vulnerability allowed the attacker to gain a significant number of COVER tokens. After the attack, Cover officials migrated the blacksmith contract to a secure version to prevent further exploitation[27]. Several hackers took advantage of this vulnerability, with one making around $4.4 million. Grap.Finance, another attacker, returned the funds via its Twitter account. CertiK is a leading audit company that performs security audits and protects crypto assets, offering CertiKShield for loss reimbursement due to hacks or exploits[27].

[24]

Grap Finance Exploiting: [30]

CertiK Technical Analysis

CertiK published a technical analysis[27].

The attacker staked the Balancer lp tokens to the Blacksmith.sol contract in Cover Protocol.

The deposit() function shown in Figure 1 is invoked in the process of staking.

By invoking the deposit function, the attacker staked BPT and received LP tokens via the cover protocol. In line 118, the contract loads and holds the pool data in the memory by a given LP token. Later, it updates the pool data by invoking updatePool function shown in line 121 in figure 2.

Please note that the pool data which is stored in line 118 of figure 1 is in the Memory location of smart contract whereas the pool data stored in line 75 of figure 2 is in Storage location of smart contract. The difference is: Memory in Solidity is a temporary place to store data whereas Storage holds data between function calls. The value of lpTotal in line 84 represents the total number of liquidity proof tokens deposited in the current contract. Since the value of lpTotal is small, the value of pool.accRewardsPerToken will increase through the formula on line 84, and the updated pool.accRewardsPerToken is stored in Storage, which will not affect the value stored in the Memory in this case.

Next, deposit() calls the _claimCoverRewards() function, as shown in line 318 in Figure 3. This specific contract minted COVER tokens with the amount of minedSinceLastUpdate for the function caller (msg.sender). The formula to calculate the number of COVER tokens that was going to be minted is shown in line 316 in Figure 3. It is controlled by the value of the three variables — — pool.accRewardsPerToken, CAL_MULTIPLIER and miner.rewardWriteoff. The value of pool.accRewardsPerToken is adopted from Memory rather than from Storage which is updated in the update() function.

We can also observe that the value of miner.rewardWriteoff is updated in line 130 in Figure 1, which occurs after invocation of the _claimCoverRewards() function shown in Figure 3. The updated miner.rewardWriteoff value should have been used to calculate the amount of COVER tokens that needs to be minted. However, the formula in line 316 in Figure 3 used the smaller miner.rewardWriteoff value that has not been updated, which as the result minted more COVER tokens than it should be.

After staking, the attacker calls the withdraw() function in the blacksmith.sol contract to retrieve the staked BPT, and get the minted COVER tokens as rewards.

By comparing the token balance table after the deposit() and the withdraw() execution, the attacker gained 704 COVER tokens.

The attacker profits by using this loophole, repeatedly executing the deposit and withdraw functions to infinitely mint tokens, and transfer the hacked tokens to their own address.

Total Amount Lost

The total amount lost has been estimated at $9,400,000 USD.

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?


"$COVER is exploited to the max."

"Extremely high weight and rewards per token. Something went terribly wrong in the Cover contract."

https://twitter.com/apedeveloper/status/1343529821054382081|Jan 3, 2023

https://web.archive.org/web/20201228121121/https://twitter.com/apedeveloper/status/1343529821054382081|Nov 3, 2023

https://twitter.com/apedeveloper/status/1343533660088246272|Nov 3, 2023

https://web.archive.org/web/20201228122625/https://twitter.com/apedeveloper/status/1343533660088246272|Nov 3, 2023

Twitter Reactions

[31]

first SAFE, then SAFE2, after that SAFE3, finally COVER, OH NO! IT'S NOT OVER YET! what's their next name?

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

The total amount recovered has been estimated at $3,696,000 USD.

Returning Funds Transaction: [24]

Ongoing Developments

What parts of this case are still remaining to be concluded?

General Prevention Policies

The decentralized finance space is still new and developing.

It is essentially impossible to prove that a smart contract is secure. More secure storage of funds involve multi-signature offline storage.

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

  1. Rekt - Leaderboard (May 13, 2021)
  2. Rekt - Cover - REKT (May 16, 2021)
  3. Cover Protocol Attack Perpetrated by White-Hat - All Funds Returned, Hacker Claims (May 18, 2021)
  4. COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims | Headlines | News | CoinMarketCap (May 18, 2021)
  5. @CoverProtocol Twitter (May 18, 2021)
  6. Cover Protocol Hacker Makes Off With Millions, Binance Halts Token Trading | Crypto Briefing (May 18, 2021)
  7. Cover Protocol (May 18, 2021)
  8. COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims (May 18, 2021)
  9. @sassal0x Twitter (May 18, 2021)
  10. Breaking: Hyped Defi Project COVER Protocol Exploited, Hacker Mints Unlimited COVER Token (May 18, 2021)
  11. Hacker Returns Stolen Funds to Cover Protocol - The Chain Bulletin (May 18, 2021)
  12. Cover Protocol Exploit Takes a Bizzare Turn, Hacker Returns All The Funds With an Important Message (May 18, 2021)
  13. COVER Hack: Cover Protocol and Binance Announce Compensation Plan for Hack Victims - Crypto World News (May 18, 2021)
  14. @GrapFinance Twitter (May 19, 2021)
  15. Attacker mints more than 1 quintillion tokens in DeFi Cover Protocol hack | Cryptonary (May 19, 2021)
  16. Messari - Bitcoin & crypto price, news, charts, and research (May 19, 2021)
  17. CipherTrace Cryptocurrency Crime and Anti-Money Laundering Report 2020 (Jun 20, 2021)
  18. SlowMist Hacked - SlowMist Zone (May 18, 2021)
  19. Blockchain Hacks: 2020 | $15 billion lost, how can we mitigate hacks in 2021? | CertiK Foundation Blog (Jul 23, 2021)
  20. Comprehensive List of DeFi Hacks & Exploits - CryptoSec (Jan 8, 2022)
  21. DeFi protocol Cover exploited, attackers minted at least 40 quintillion tokens (Jan 9, 2022)
  22. https://mobile.twitter.com/guronghuieric/status/1343672295857016832 (Jan 10, 2022)
  23. banteg - "The biggest exploiter has burned the tokens after cashing out 4374 ether ($3.2 million)." - Twitter (Nov 3, 2023)
  24. 24.0 24.1 24.2 Transaction Returning 4,350 ETH to Cover Protocol - Etherscan (Nov 3, 2023)
  25. amanusk_ - "This service is free! (to watch, not to use)" - Twitter (Jul 24, 2022)
  26. Certik - "Unfortunately it looks like the $COVER token was exploited today. All funds were returned but they exposed a vulnerability." - Twitter (Jan 10, 2022)
  27. 27.0 27.1 27.2 27.3 27.4 27.5 Shentu Foundation - Cover Token’s Vulnerability Analysis - Medium (Nov 3, 2023)
  28. CertiK Community - "A summary of the $COVER vulnerability exploit. There's still a lot to the story but here's an analysis from leading security engineers" - Twitter (Nov 3, 2023)
  29. CertiK - "A summary of the $COVER vulnerability exploit!" - Twitter (Jan 10, 2022)
  30. Grap Finance Transaction History - Etherscan (Nov 3, 2023)
  31. darkforest_lian - "first SAFE, then SAFE2, after that SAFE3, finally COVER, OH NO! IT'S NOT OVER YET! what's their next name?" - Twitter (Nov 3, 2023)