Charge DeFi Flash Loan Attack
Notice: This page is a new case study and some aspects have not been fully researched. Some sections may be incomplete or reflect inaccuracies present in initial sources. Please check the References at the bottom for further information and perform your own additional assessment. Please feel free to contribute by adding any missing information or sources you come across. 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!
Charge DeFi suffered a Flash loan exploit to one of their smart contract hot wallets for new 60/40 vaults. This was apparently the same exploit as occurred with Grim Finance. They've reimbursed more than what was lost to all affected users, replacing the tokens and providing 50 BUSD per lost Charge.
This is a global/international case not involving a specific country.[1][2][3][4][5][6][7]
About Charge DeFi
"ChargeDeFi is a new platform launching on BSC combining a traditional Algorithmic Stablecoin (pegged to $1.0 BUSD) with rebase mechanics. Featuring an extensive ecosystem of smart reinvestment pools, bond pools that yield below peg and multiple boardroom options ChargeDeFi enters BSC with a large set of investment options. Initially launching on BSC the next step will be multichain."
"Earn 4.9% daily! Stake your $Charge and $Static-BUSD in the boardroom to receive rewards through our Algorithmic Stablecoin ecosystem with rebase mechanics. Daily rate is subject to change, please read our gitbook before investing."
"If an investor stakes into the $Static-BUSD vault 40% of that stake is swapped into $Charge and staked into the $Charge vault. Both vaults are auto-compounding. The $Charge vault additionally has a 48hr lock window and a 2 hour unlock window. During this unlock window the vault is compounded and investors can take out their earnings. After this window, the vault is locked again for 48 hours."
"These vaults are simple and so we decided to look around for these in other projects. We decided to fork from Grim.Finance for the 60/40 auto-compounding vaults, which had been audited by Solidity Finance and had a substantial TVL. In particular, the audit report states that reentrancy protection is in place."
The Reality
"Following the launch and our audit, Charge decided to add 2 auto-compounding vaults $Static-BUSD vault. $Charge vault."
The Charge DeFi smart contract was unaudited. While it took mechanisms from the Grim Finance smart contract, which was audited, there was only a single audit performed, which missed a critical defect.
What Happened
On December 18th "at 07:12 UTC an attacker set up a flash loan for $Charge and abused the Charge vault on ChargeDeFi. 1849 charge was sold off.
Date | Event | Description |
---|---|---|
December 18th, 2021 | Main Event | Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here. |
December 20th, 2021 9:58:00 AM MST | Compensation Update Tweet | Charge DeFi notifies users that they have completed the airdrop of $50 BUSD per charge token to every holder of the protocol, and are still finalizing details of the Charge repayment[10]. |
December 20th, 2021 2:36:00 PM MST | Incident Report Released | Charge DeFi releases their incident report[11]. |
Technical Details
1849 charge was sold off.
"The exploiter managed to take out 2185.6 $Charge tokens at a value of $530 at the time of the exploit. It was traded for BUSD and then swapped to 955 WBNB. The value of this transaction was approximately $520k. The amount the attacker received for his $Charge was lower than the $1.16m value of the stolen tokens. This is due to limited liquidity. As the attacker sold off his tokens the price dropped fast."
Incident Report: [11]
Total Amount Lost
On December 18th "at 07:12 UTC an attacker set up a flash loan for $Charge and abused the Charge vault on ChargeDeFi. 1849 charge was sold off.
"The exploiter managed to take out 2185.6 $Charge tokens at a value of $530 at the time of the exploit. It was traded for BUSD and then swapped to 955 WBNB. The value of this transaction was approximately $520k. The amount the attacker received for his $Charge was lower than the $1.16m value of the stolen tokens. This is due to limited liquidity. As the attacker sold off his tokens the price dropped fast."
The total amount lost has been estimated at $1,160,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?
On December 18th "at 07:12 UTC an attacker set up a flash loan for $Charge and abused the Charge vault on ChargeDeFi. 1849 charge was sold off. We're in contact with forensics agencies and the vaults have been paused." "Wallet balances are being gathered for a compensation plan afterwards."
"Only the new 60/40 vaults were affected! Other parts of ChargeDefi are unaffected!" "[W]e are extremely sorry for today's incident. We have put together a package that will help recoup the lost tokens."
"As soon as we knew the site was safe, informed possible targets and contacted investigation agencies, we moved on to a compensation plan to try and settle investors concerns. We considered various methods of compensation but had to consider the damage each route could put upon the ecosystem."
Ultimate Outcome
The Chrage DeFi team implemented a compensation plan.
Compensation Plan And Implementation
The Charge DeFi team initially released the $50 BUSD ahead of the rest of the reimbursement[10].
As part of our compensation plan to the $Charge holders from Saturday's incident, we have completed the airdrop of $50 $BUSD per Charge token lost. Concerning the Charge repayment, we are just finalising a few details and will share details on this later today.
While well received by most of the community, this did cause some confusion[15][16].
"Wow.. Thanks for redistributing 1% of the funds I deposited. Great reimbursement program.. What a joke..."
"Please read the posts carefully. All charge will be reimbursed. On top of that wallets that lost charge will receive an extra 50 BUSD per charge lost."
"The compensation pool for lost charge has just been released. The farm will start as soon as the start block is reached. Over a period of ~30 days Charge will slowly build up in this pool. You can claim at any time, also after the pool ends."
"Charge Defi has already dished out much of its 100+%compensation" "#ChargeDeFi is getting stronger and stronger with the help of our great community."
Total Amount Recovered
The Charge DeFi team was reportedly able to cover all losses, and additionally send $50 BUSD per lost token to all affected users.
"Compensation: Full repayment of tokens plus $50 BUSD per Charge token lost." "ChargeDeFi builds a list of affected wallets and their lost Charge tokens, which is then shared with the community for cross-checking. Affected wallets will receive an equal amount of Charge tokens over a period of approximately 30 days. A special farm pool will be set up for this. This is a normal farm pool for wallets that have lost their Charge, not for other stakers. During this 30 day period, the farm will yield Charge that can be claimed at any time. After these 30 days all lost Charge will be compensated for. Affected wallets will also receive an airdrop of $50 BUSD per Charge lost, on top of regaining their original Charge." "The Charge used in this compensation method will be supplied by the project wallet. No extra Charge will be minted, the team has decided to supply this from the daily balance of Charge sent to the project wallet."
"The compensation pool for lost charge has just been released. The farm will start as soon as the start block is reached. Over a period of ~30 days Charge will slowly build up in this pool. You can claim at any time, also after the pool ends."
"Charge Defi has already dished out much of its 100+%compensation" "#ChargeDeFi is getting stronger and stronger with the help of our great community."
Ongoing Developments
TBD
Individual Prevention Policies
The Charge DeFi smart contract was unaudited. While it took mechanisms from the Grim Finance smart contract, which was audited, there was only a single audit performed, which missed a critical defect. It should not have been used to store funds.
Avoid the use of smart contracts unless necessary. Minimize the level of exposure by removing or withdrawing assets whenever possible. Aim to choose smart contracts which have obtained third party security audits, preferably having been audited by at least three separate reputable firms. Pay attention to the audit reports, which smart contracts are covered, and whether the smart contract has been upgraded or modified since the report. Ensure that any administrative functions with the ability to remove funds from the smart contract are under the authority of a multi-signature wallet which is controlled by at least three separate and reputable entities.
Users can reduce risks by storing less funds in smart contracts, and keeping most funds offline.
Store the majority of funds offline. By offline, it means that the private key and/or seed phrase is exclusively held by you and not connected to any networked device. Examples of offline storage include paper wallets (seed phrase or key written down and deleted from all electronic media), hardware wallets, steel wallet devices, etc...
For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.
Platform Prevention Policies
The Charge DeFi smart contract was unaudited. While it took mechanisms from the Grim Finance smart contract, which was audited, there was only a single audit performed, which missed a critical defect. It should not have been used to store funds.
All aspects of any platform should undergo a regular validation/inspection by experts. This validation should include a security audit of any smart contracts, reporting any risks to the backing (of any customer assets, ensuring treasuries or minting functions are properly secured under the control of a multi-signature wallet, and finding any inadequacies in the level of training or integrity of the team. The recommended interval is twice prior to launch or significant system upgrade, once after 3 months, and every 6 months thereafter. It is recommended that the third party performing the inspection not be repeated within a 14 month period.
A more secure method of handling for minting and withdrawal functions is a multi-signature wallet. This can be used to significantly limit the amount of funds at risk, and larger mints/withdrawals require signatures from all separate trained team members.
All wallets, minting functions, and critical infrastructure should be implemented with a multi-signature requirement, with a recommended minimum of 3 signatures required. This means that making important changes or approving spending will require the keys held by at least 3 separate individuals within the organization to approve. The multi-signature should be implemented at the lowest layer possible, all key holders should have security training, and all key holders should be empowered and encouraged to exercise diligence.
In the event of a smart contract breach where a protocol cannot cover losses, an industry insurance fund can provide assistance. While the full amount is not guaranteed, particularly in cases of using unaudited smart contracts, it provides a solution to assist all affected users and avoid the devastation of a complete loss.
Work with other industry platforms to set up a multi-signature wallet with private keys held separately by delegate signatories from seven prominent platforms and services within the industry. Establish requirements for contributions by all platforms and services, designed to be affordable for small platforms yet large enough to cover anticipated breach events. Any breach event can be brought forth by a member platform or a petition of 100 signatures for consideration by the delegate signatories. A vote of 4 or more delegate signatures is required to release any funds, which could partially or fully restore lost funds based on their assessment.
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
The Charge DeFi smart contract was unaudited. While it took mechanisms from the Grim Finance smart contract, which was audited, there was only a single audit performed, which missed a critical defect. It should not have been used to store funds.
All platforms should undergo published security and risk assessments by independent third parties. Two assessments are required at founding or major upgrade, one after 3 months, and one every 6 months thereafter. The third parties must not repeat within the past 14 months. A risk assessment needs to include what assets back customer deposits and the risk of default from any third parties being lent to. The security assessment must include ensuring a proper multi-signature wallet, and that all signatories are properly trained. Assessments must be performed on social media, databases, and DNS security.
In the event of a smart contract breach where a protocol cannot cover losses, an industry insurance fund can provide assistance. While the full amount is not guaranteed, particularly in cases of using unaudited smart contracts, it provides a solution to assist all affected users and avoid the devastation of a complete loss.
Set up a multi-signature wallet with private keys held separately by delegate signatories from seven prominent platforms and services within the industry. Establish requirements for contributions by all platforms and services within the country, designed to be affordable for small platforms yet large enough to cover anticipated breach events. Any breach event can be brought forth by a member platform or a petition of 100 signatures for consideration by the delegate signatories. A vote of 4 or more delegate signatures is required to release any funds, which could partially or fully restore lost funds based on their assessment.
For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.
References
- ↑ @financegrim Twitter (Jan 3, 2022)
- ↑ passive income 2021 | charge defi hacked | - YouTube (Jan 5, 2022)
- ↑ @ChargeDeFi Twitter (Jan 5, 2022)
- ↑ @ChargeDeFi Twitter (Jan 5, 2022)
- ↑ Chargedefi Security Incident (Jan 5, 2022)
- ↑ @ChargeDeFi Twitter (Jan 5, 2022)
- ↑ @ChargeDeFi Twitter (Jan 5, 2022)
- ↑ 8.0 8.1 https://coinmarketcap.com/currencies/chargedefi/ (Jan 5, 2022)
- ↑ Welcome - Charge DeFi docs (Jan 5, 2022)
- ↑ 10.0 10.1 Charge DeFi - "As part of our compensation plan to the $Charge holders from Saturday's incident, we have completed the airdrop of $50 $BUSD per Charge token lost. Concerning the Charge repayment, we are just finalising a few details and will share details on this later today." - Twitter (Jan 5, 2022)
- ↑ 11.0 11.1 Charge DeFi - "We just released our incident report on the vault exploit at ChargeDeFi. Including a full timeline and communication to external parties, compensation for affected investors and lessons learned/implemented." - Twitter (Jan 5, 2022)
- ↑ https://bscscan.com/tx/0x88b2f15cae1ee599c779b207c496e55015718130b92533bfbeee03e9a97e68df (Jan 5, 2022)
- ↑ https://bscscan.com/tx/0x67a2ca92c59cedc8738a52c1dcd8a7ce1715191731b6c3eb5b2df2a5dabaf5a4 (Jan 5, 2022)
- ↑ https://bscscan.com/tx/0x41c8266f380693c41708065bf4cfcfa09e5625af207f970b5ff0fd4d50b706fc (Jan 5, 2022)
- ↑ CryptoStacs - "Wow.. Thanks for redistributing 1% of the funds I deposited. Great reimbursement program.. What a joke..." - Twitter (Sep 5, 2023)
- ↑ Charge DeFi - "Please read the posts carefully. All charge will be reimbursed. On top of that wallets that lost charge will receive an extra 50 BUSD per charge lost." - Twitter (Sep 5, 2023)