DForce Network Reentrancy Vulnerability: Difference between revisions

From Quadriga Initiative Cryptocurrency Hacks, Scams, and Frauds Repository
Jump to navigation Jump to search
(Created page with "{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/dforcenetworkreentrancyvulnerability.php}} {{Unattributed Sources}} thumb|DForce NetworkdForce is a decentralized financial network that provides a complete set of DeFi protocols covering assets, lending, and trading. Its protocols are deployed on several blockchains, including Ethereum, Binance Smart Chain, Polygon, and KAVA. The reentrancy vulnerability in Curve has be...")
 
(Initial 30 minutes. All sources integrated.)
Line 1: Line 1:
{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/dforcenetworkreentrancyvulnerability.php}}
{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/dforcenetworkreentrancyvulnerability.php}}[[File:Dforcenetwork.jpg|thumb|DForce Network]]dForce is a decentralized financial network that provides a complete set of DeFi protocols covering assets, lending, and trading. Its protocols are deployed on several blockchains, including Ethereum, Binance Smart Chain, Polygon, and KAVA. The reentrancy vulnerability in Curve has been well-known, and the same vulnerability was exploited in an attack that netted $1.9M on Arbitrum and $1.7M on Optimism against DForce. The attack involved flash loaned funds being deposited into Curve's wstETH/ETH and then into dForce's wstETHCRV-gauge vault. The attacker then used the remove_liquidity function to manipulate the virtual price, which dForce uses as an oracle for the wstETHCRV-gauge tokens. dForce confirmed the incident, paused all vaults, and later announced that users' funds supplied to dForce Lending and other vaults were safe. The good news is that the exploiter returned all funds to dForce multisigs a few days later.
{{Unattributed Sources}}


[[File:Dforcenetwork.jpg|thumb|DForce Network]]dForce is a decentralized financial network that provides a complete set of DeFi protocols covering assets, lending, and trading. Its protocols are deployed on several blockchains, including Ethereum, Binance Smart Chain, Polygon, and KAVA. The reentrancy vulnerability in Curve has been well-known, and the same vulnerability was exploited in an attack that netted $1.9M on Arbitrum and $1.7M on Optimism against DForce. The attack involved flash loaned funds being deposited into Curve's wstETH/ETH and then into dForce's wstETHCRV-gauge vault. The attacker then used the remove_liquidity function to manipulate the virtual price, which dForce uses as an oracle for the wstETHCRV-gauge tokens. dForce confirmed the incident, paused all vaults, and later announced that users' funds supplied to dForce Lending and other vaults were safe. The good news is that the exploiter returned all funds to dForce multisigs a few days later.
== About DForce Network ==
dForce is a decentralized financial network that provides a complete set of DeFi protocols covering assets, lending, and trading. Its protocols are deployed on several blockchains, including Ethereum, Binance Smart Chain, Polygon, and KAVA. USX is dForce's over-collateralized stablecoin that implements multiple minting modules and a hybrid interest policy to efficiently improve liquidity on the secondary market. The DF token is used for network governance and DF holders can stake their tokens to earn fee income, inflationary rewards, and ecosystem airdrops. The network also provides PoS validation services and a decentralized lending and borrowing platform<ref name="dforcenetwork-10870" /><ref name="dforcenetworkdocs-10871" /><ref name="dforcenetworkdocs-10872" />.


This is a global/international case not involving a specific country.<ref name="rektnews-10864" /><ref name="optimistic-10865" /><ref name="optimistic-10866" /><ref name="rekthqtwitter-10867" /><ref name="chainsecurity-10868" /><ref name="dforcenettwitter-10869" /><ref name="dforcenetwork-10870" /><ref name="dforcenetworkdocs-10871" /><ref name="dforcenetworkdocs-10872" />
== About DForce Network ==
"dForce advocates for building a complete set of DeFi protocols covering assets, lending, and trading, serving as DeFi infrastructure in Web 3. dForce is currently deployed on Ethereum, Arbitrum, Optimism, Polygon, Binance Smart Chain (BSC), and KAVA."
"dForce advocates for building a complete set of DeFi protocols covering assets, lending, and trading, serving as DeFi infrastructure in Web 3. dForce is currently deployed on Ethereum, Arbitrum, Optimism, Polygon, Binance Smart Chain (BSC), and KAVA."


Line 21: Line 18:
"Peer-to-Peer marketplace with aggregated liquidity across different platforms with the best price."
"Peer-to-Peer marketplace with aggregated liquidity across different platforms with the best price."


"The vulnerability has been well-known for some time. According to ChainSecurity’s original report:
On April 14, we informed Curve and affected projects about a read-only reentrancy vulnerability in some Curve pools. More specifically, the value of function get_virtual_price can be manipulated by reentering it during the removal of liquidity.”
And Curve have provided a known workaround:
one can call any method which has the nonreentrant lock (removing 0 liquidity is probably the cheapest)."


"Shortly after 11pm Thursday night (UTC), an attack on two fronts exploited a common reentrancy vulnerability, netting $1.9M on Arbitrum and $1.7M on Optimism."
"Shortly after 11pm Thursday night (UTC), an attack on two fronts exploited a common reentrancy vulnerability, netting $1.9M on Arbitrum and $1.7M on Optimism."
Line 59: Line 49:


== The Reality ==
== The Reality ==
"The vulnerability has been well-known for some time. According to ChainSecurity’s original report:
On April 14, we informed Curve and affected projects about a read-only reentrancy vulnerability in some Curve pools. More specifically, the value of function get_virtual_price can be manipulated by reentering it during the removal of liquidity.”
And Curve have provided a known workaround:
one can call any method which has the nonreentrant lock (removing 0 liquidity is probably the cheapest)."
<ref name="chainsecurity-10868" />
This sections is included if a case involved deception or information that was unknown at the time. Examples include:
This sections is included if a case involved deception or information that was unknown at the time. Examples include:


Line 76: Line 76:
|February 9th, 2023 4:11:02 PM MST
|February 9th, 2023 4:11:02 PM MST
|Attack Transaction
|Attack Transaction
|The attack transaction occurred on the blockchain.
|The attack transaction occurred on the blockchain<ref name="optimistic-10865" /><ref name="optimistic-10866" />.
|-
|February 12th, 2023 8:00:27 PM MST
|Attacker Returns Funds
|The actual blockchain transaction where the attacker returns the funds<ref>[https://arbiscan.io/tx/0x97f7510ade6118552e9d206b5441b13ba1c8910fdd4f82fcf7482de2cf340ecb Attacker Returns The Funds - Arbiscan] (May 3, 2023)</ref>.
|-
|February 12th, 2023 10:29:00 PM MST
|Announcement of Funds Returned
|DForce Networks posts on Twitter to announce that the funds have been returned and they have agreed on a bounty for the exploit. The exploiter, who came forward as a whitehat, has agreed to a bounty, and the team will drop all on-going investigations and law enforcement actions. The team thanked their community, ecosystem partners, and friends for their support and committed to doubling down on expanding their bounty program to encourage more responsible hacking. They also shared a transaction confirming the return of the exploited funds<ref name="dforcenettwitter-10869" />.
|-
|February 13th, 2023 12:27:00 PM MST
|RektHQ Publication
|RektHQ publishes about the situation<ref name="rekthqtwitter-10867" />. They report that dForce Network suffered an attack on both Arbitrum and Optimism that exploited a common reentrancy vulnerability, resulting in a loss of $3.65 million. However, the exploiter returned all funds a few days later, and dForce confirmed that all impacted users will be made whole. The vulnerability, which is well-known, has affected other DeFi projects, including Midas Capital and Market.xyz. The attacker used flash loaned funds to deposit into Curve's wstETH/ETH and exploited the reentrancy vulnerability to manipulate the virtual price, resulting in profiting from the liquidation of other users using wstETHCRV-gauge as collateral. While Layer 2 networks have been enjoying a boom in adoption, increased usage also attracts malicious actors seeking to profit by any means necessary<ref name="rektnews-10864" />.
|}
|}


== Technical Details ==
== 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?
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?
<ref name="optimistic-10865" /><ref name="optimistic-10866" />


== Total Amount Lost ==
== Total Amount Lost ==
Line 92: Line 106:
== Ultimate Outcome ==
== Ultimate Outcome ==
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?
=== Attacker Returns The Funds ===
DForce announced that the exploiter had come forward and returned the funds<ref name="dforcenettwitter-10869" />.<blockquote>1/5 On Feb 13, 2023, the exploited funds were fully returned to our multi-sig on both Arbitrum and Optimism, a perfect ending for all. All impacted users will be made whole, we will announce the details for distribution of the funds over the next few days.
2/5 Shortly after the incident, we entered into conversations with the exploiter, who came forward as a whitehat. We have agreed to offer a bounty and will drop all on-going investigation and law enforcement actions.
3/5 We would like to thank our community, ecosystem partners and friends for their supports, particularly, SlowMist
@SlowMist_Team for assisting in our investigation, and @samczsun and @tzhen for reaching out to offer help.
4/5 Security is the only thing that keeps us awake and it's a never-ending exercise. We have spent >$3m on security audits, bounty programs over the past few years, and are committed to doubling down on expanding our bounty program to encourage more responsible hacking.
5/5 Exploited fund return tx.</blockquote>


== Total Amount Recovered ==
== Total Amount Recovered ==
Line 116: Line 143:


== References ==
== References ==
<references><ref name="rektnews-10864">[https://rekt.news/dforce-network-rekt/ Rekt - dForce Network - REKT] (May 3, 2023)</ref>
<references>
 
<ref name="rektnews-10864">[https://rekt.news/dforce-network-rekt/ Rekt - dForce Network - REKT] (May 3, 2023)</ref>
<ref name="optimistic-10865">[https://optimistic.etherscan.io/tx/0x6c19762186c9f32c81eb2a79420fc7ad4485aa916cab37ec278b216757bfba0d Optimistic L2 Transaction Hash (Txhash) Details | Optimism] (May 3, 2023)</ref>
<ref name="optimistic-10865">[https://optimistic.etherscan.io/tx/0x6c19762186c9f32c81eb2a79420fc7ad4485aa916cab37ec278b216757bfba0d Optimistic L2 Exploit Transaction - Optimism] (May 3, 2023)</ref>
 
<ref name="optimistic-10866">[https://optimistic.etherscan.io/address/0xe0d551017c0111ac11108641771897aa33b2817c dForcenet Exploiter Address - Optimism] (May 3, 2023)</ref>
<ref name="optimistic-10866">[https://optimistic.etherscan.io/address/0xe0d551017c0111ac11108641771897aa33b2817c dForcenet Exploiter | Address 0xe0d551017c0111ac11108641771897aa33b2817c | Optimism] (May 3, 2023)</ref>
<ref name="rekthqtwitter-10867">[https://twitter.com/RektHQ/status/1625215197446021128 RektHQ - "The attack came on both Arbitrum and Optimism, via a common reentrancy vulnerability." - Twitter] (May 3, 2023)</ref>
 
<ref name="rekthqtwitter-10867">[https://twitter.com/RektHQ/status/1625215197446021128 @RektHQ Twitter] (May 3, 2023)</ref>
 
<ref name="chainsecurity-10868">[https://chainsecurity.com/curve-lp-oracle-manipulation-post-mortem/ Curve LP Oracle Manipulation: Post Mortem - Chainsecurity] (May 3, 2023)</ref>
<ref name="chainsecurity-10868">[https://chainsecurity.com/curve-lp-oracle-manipulation-post-mortem/ Curve LP Oracle Manipulation: Post Mortem - Chainsecurity] (May 3, 2023)</ref>
 
<ref name="dforcenettwitter-10869">[https://twitter.com/dForcenet/status/1625004207395807232 dForcenet - "On Feb 13, 2023, the exploited funds were fully returned to our multi-sig on both Arbitrum and Optimism, a perfect ending for all." - Twitter] (May 3, 2023)</ref>
<ref name="dforcenettwitter-10869">[https://twitter.com/dForcenet/status/1625004207395807232 @dForcenet Twitter] (May 3, 2023)</ref>
 
<ref name="dforcenetwork-10870">[https://dforce.network/ dForce] (May 3, 2023)</ref>
<ref name="dforcenetwork-10870">[https://dforce.network/ dForce] (May 3, 2023)</ref>
<ref name="dforcenetworkdocs-10871">[https://docs.dforce.network/ GETTING STARTED - dForce] (May 3, 2023)</ref>
<ref name="dforcenetworkdocs-10871">[https://docs.dforce.network/ GETTING STARTED - dForce] (May 3, 2023)</ref>
 
<ref name="dforcenetworkdocs-10872">[https://docs.dforce.network/protocols/usx USX - dForce] (May 3, 2023)</ref>
<ref name="dforcenetworkdocs-10872">[https://docs.dforce.network/protocols/usx USX - dForce] (May 3, 2023)</ref></references>
</references>

Revision as of 22:28, 3 May 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' 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.

DForce Network

dForce is a decentralized financial network that provides a complete set of DeFi protocols covering assets, lending, and trading. Its protocols are deployed on several blockchains, including Ethereum, Binance Smart Chain, Polygon, and KAVA. The reentrancy vulnerability in Curve has been well-known, and the same vulnerability was exploited in an attack that netted $1.9M on Arbitrum and $1.7M on Optimism against DForce. The attack involved flash loaned funds being deposited into Curve's wstETH/ETH and then into dForce's wstETHCRV-gauge vault. The attacker then used the remove_liquidity function to manipulate the virtual price, which dForce uses as an oracle for the wstETHCRV-gauge tokens. dForce confirmed the incident, paused all vaults, and later announced that users' funds supplied to dForce Lending and other vaults were safe. The good news is that the exploiter returned all funds to dForce multisigs a few days later.

About DForce Network

dForce is a decentralized financial network that provides a complete set of DeFi protocols covering assets, lending, and trading. Its protocols are deployed on several blockchains, including Ethereum, Binance Smart Chain, Polygon, and KAVA. USX is dForce's over-collateralized stablecoin that implements multiple minting modules and a hybrid interest policy to efficiently improve liquidity on the secondary market. The DF token is used for network governance and DF holders can stake their tokens to earn fee income, inflationary rewards, and ecosystem airdrops. The network also provides PoS validation services and a decentralized lending and borrowing platform[1][2][3].

"dForce advocates for building a complete set of DeFi protocols covering assets, lending, and trading, serving as DeFi infrastructure in Web 3. dForce is currently deployed on Ethereum, Arbitrum, Optimism, Polygon, Binance Smart Chain (BSC), and KAVA."

"Peer-to-Peer & Decentralized Financial Network. Permission-less and open – everyone with internet access can participate. Non-custodial – minimal trust cost, users always have ownership over their crypto assets. Open-sourced – anyone can integrate with dForce and build your own product on top of our protocols. Decentralized – dForce (DF) token empowers the governance of the network."

"USX is an over-collateralized stablecoin implementing multiple minting modules including global-pool, vault, and LSR. USX's dollar peg is mainly dictated by a hybrid interest policy that can efficiently improves USX's liquidity on secondary market by adjusting its lending and borrowing rates on supported protocols. Powered by the LSR module, USX is also 1:1 tradable with other supported stablecoins directly through dForce Trade."

"DF Staking [is a] hybrid staking model for DF holders to capture fee income, inflationary rewards, and ecosystem airdrop across the network."

"PoS Staking [is p]roviding [a] validation service in PoS networks by participating in their governance and maintaining the security of the network, further aligning DeFi infrastructure with the broader blockchain ecosystem."

"Enabling decentralized lending and borrowing through smart contracts, automating the execution on the protocol."

"Peer-to-Peer marketplace with aggregated liquidity across different platforms with the best price."


"Shortly after 11pm Thursday night (UTC), an attack on two fronts exploited a common reentrancy vulnerability, netting $1.9M on Arbitrum and $1.7M on Optimism."

"The alarm was raised a few hours later, and dForce confirmed the incident after a further 90 minutes. The team then expanded on their original announcement, stating that they had pause all vaults and adding: Users' funds supplied to dForce Lending and other vaults are SAFE."

"The exploit used flash loaned funds to deposit into Curve’s wstETH/ETH, depositing the LP tokens into dForce’s wstETHCRV-gauge vault.

Upon calling the remove_liquidity function, the attacker’s contract exploited the reentrancy vulnerability to manipulate the virtual price, which dForce uses as an oracle for the wstETHCRV-gauge tokens."

"Good news came a few days later, when the exploiter returned all funds to dForce multisigs."

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

"The vulnerability has been well-known for some time. According to ChainSecurity’s original report:

On April 14, we informed Curve and affected projects about a read-only reentrancy vulnerability in some Curve pools. More specifically, the value of function get_virtual_price can be manipulated by reentering it during the removal of liquidity.”

And Curve have provided a known workaround:

one can call any method which has the nonreentrant lock (removing 0 liquidity is probably the cheapest)."

[4]

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 - DForce Network Reentrancy Vulnerability
Date Event Description
February 9th, 2023 4:11:02 PM MST Attack Transaction The attack transaction occurred on the blockchain[5][6].
February 12th, 2023 8:00:27 PM MST Attacker Returns Funds The actual blockchain transaction where the attacker returns the funds[7].
February 12th, 2023 10:29:00 PM MST Announcement of Funds Returned DForce Networks posts on Twitter to announce that the funds have been returned and they have agreed on a bounty for the exploit. The exploiter, who came forward as a whitehat, has agreed to a bounty, and the team will drop all on-going investigations and law enforcement actions. The team thanked their community, ecosystem partners, and friends for their support and committed to doubling down on expanding their bounty program to encourage more responsible hacking. They also shared a transaction confirming the return of the exploited funds[8].
February 13th, 2023 12:27:00 PM MST RektHQ Publication RektHQ publishes about the situation[9]. They report that dForce Network suffered an attack on both Arbitrum and Optimism that exploited a common reentrancy vulnerability, resulting in a loss of $3.65 million. However, the exploiter returned all funds a few days later, and dForce confirmed that all impacted users will be made whole. The vulnerability, which is well-known, has affected other DeFi projects, including Midas Capital and Market.xyz. The attacker used flash loaned funds to deposit into Curve's wstETH/ETH and exploited the reentrancy vulnerability to manipulate the virtual price, resulting in profiting from the liquidation of other users using wstETHCRV-gauge as collateral. While Layer 2 networks have been enjoying a boom in adoption, increased usage also attracts malicious actors seeking to profit by any means necessary[10].

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?

[5][6]

Total Amount Lost

The total amount lost has been estimated at $3,850,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?

Attacker Returns The Funds

DForce announced that the exploiter had come forward and returned the funds[8].

1/5 On Feb 13, 2023, the exploited funds were fully returned to our multi-sig on both Arbitrum and Optimism, a perfect ending for all. All impacted users will be made whole, we will announce the details for distribution of the funds over the next few days.

2/5 Shortly after the incident, we entered into conversations with the exploiter, who came forward as a whitehat. We have agreed to offer a bounty and will drop all on-going investigation and law enforcement actions.

3/5 We would like to thank our community, ecosystem partners and friends for their supports, particularly, SlowMist

@SlowMist_Team for assisting in our investigation, and @samczsun and @tzhen for reaching out to offer help.

4/5 Security is the only thing that keeps us awake and it's a never-ending exercise. We have spent >$3m on security audits, bounty programs over the past few years, and are committed to doubling down on expanding our bounty program to encourage more responsible hacking.

5/5 Exploited fund return tx.

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