Uniswap ERC777 Reentrancy Attack: Difference between revisions

From Quadriga Initiative Cryptocurrency Hacks, Scams, and Frauds Repository
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 4: Line 4:
[[File:Uniswap.jpg|thumb|Uniswap]]Significant funds were stored within a hot wallet/smart contract. In this exploit, one contract is run within another, enabling balances to be reduced before they are checked. This exploit was known since July of 2019, and never patched or investigated until finally being exploited.
[[File:Uniswap.jpg|thumb|Uniswap]]Significant funds were stored within a hot wallet/smart contract. In this exploit, one contract is run within another, enabling balances to be reduced before they are checked. This exploit was known since July of 2019, and never patched or investigated until finally being exploited.


The country for this case study is not yet known.<ref name="coinspeaker-313" /><ref name="tokenlontwitter-314" /><ref name="zdnet-315" /><ref name="github-316" /><ref name="securityboulevard-317" /><ref name="defirate-318" /><ref name="openzeppelinblog-319" /><ref name="peckshieldblog-326" /><ref name="ciphertrace-1152" /><ref name="slowmisthacked-678" /><ref name="openzeppelinforum-1155" /><ref name="peckshieldmedium-1556" /><ref name="coinmonksmedium-1086" /><ref name="certik-1776" />
The country for this case study is not yet known.<ref name="coinspeaker-313" /><ref name="tokenlontwitter-314" /><ref name="zdnet-315" /><ref name="github-316" /><ref name="securityboulevard-317" /><ref name="defirate-318" /><ref name="openzeppelinblog-319" /><ref name="peckshieldblog-326" /><ref name="ciphertrace-1152" /><ref name="slowmisthacked-678" /><ref name="openzeppelinforum-1155" /><ref name="peckshieldmedium-1556" /><ref name="coinmonksmedium-1086" /><ref name="certik-1776" /><ref name="unnamed-12199" />


== About Uniswap ==
== About Uniswap ==
Line 128: Line 128:
<ref name="coinmonksmedium-1086">[https://medium.com/coinmonks/how-does-uniswap-work-75765c4640e0 How Does Uniswap Work] (Jun 5, 2021)</ref>
<ref name="coinmonksmedium-1086">[https://medium.com/coinmonks/how-does-uniswap-work-75765c4640e0 How Does Uniswap Work] (Jun 5, 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></references>
<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="unnamed-12199">[https://web.archive.org/web/20200915094347/https://codefi.consensys.net/blog/security-risks-in-ethereum-defi?utm_campaign=ConsenSys%20Newsletter&utm_medium=email&_hsmi=88736023&utm_content=88730521&utm_source=hs_email Security Risks in Ethereum DeFi | ConsenSys Codefi] (Nov 15, 2023)</ref></references>

Latest revision as of 14:06, 10 May 2024

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!

Uniswap

Significant funds were stored within a hot wallet/smart contract. In this exploit, one contract is run within another, enabling balances to be reduced before they are checked. This exploit was known since July of 2019, and never patched or investigated until finally being exploited.

The country for this case study is not yet known.[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15]

About Uniswap

"Uniswap is an Ethereum exchange, built using smart contracts and liquidity pools, as opposed to the order book of a traditional centralized exchange (CEX), such as Binance. With any Ethereum wallet, users can simply connect to the Uniswap application and effortlessly exchange ERC20 tokens without first sending them to the exchange platform account."

"[T]he development of Uniswap was facilitated by Vitalik Buterin’s idea for a decentralized exchange (DEX), which would involve an automated market maker. Actually, the protocol developer himself, Hayden Adams, at first tried to just practice development on Solidity, and later this hobby brought him several grants and $100 000 from the Ethereum Foundation. Now the project went far beyond just entertainment and became one of the most important components of the entire DeFi industry."

"Started at 12:58:19 AM +UTC, Apr-18–2020, a known reentrancy vulnerability was exploited on Uniswap against the imBTC liquidity pool…" "The exploit allowed the attacker to drain roughly $300k worth of value due to a reentrancy attack which allowed funds to be drained in a similar fashion to what happened with The DAO back in 2016." "[T]he attacker was able to call the Uniswap smart contract to withdraw funds before the external balance could be updated, effectively creating a cycle in which all the tokens in the contract could be purchased for pennies." "The Uniswap cyberattack reportedly exploited an already known shortcoming that majorly affects the ERC777 token standard."

"Specifically, in the Uniswap hack, the attacker exploits the vulnerability to drain the Uniswap liquidity pool of ETH-imBTC (with about 1,278 ETH)while in the Lendf.Me hack, the attacker makes use of it to (arbitrarily) increase the internal record of the attacker’s imBTC collateral amount so that she can borrow (and indeed borrow) a variety of 10+ assets from all available Lendf.Me liquidity pools (with total asset value of $25,236,849.44)."

"It was confirmed that all Uniswap smart contracts that comprise of imBTC, an ETH-based, tokenized version of BTC that is operated by TokenIon, were entirely drained." "[T]he imBTC pool on Uniswap [was] attacked & drained. The hacker utilized an attack vector on ERC777 tokens on Uniswap." "According to investigators, hackers appear to have chained together bugs and legitimate features from different blockchain technologies to orchestrate a sophisticated "reentrancy attack."" "[T]he combination of using ERC777 tokens and Uniswap/Lendf.Me contracts enables [...] reentrancy attacks," "The first target on the attackers’ list was Uniswap, a fully decentralized peer-to-peer cryptocurrency exchange platform, providing users with a means to trade Ethereum cryptocurrency. In this case, the hackers stole between $300,000 and $1.1 million (in imBTC tokens)."

"[B]oth Uniswap and Lendf.Me were taken offline to prevent further attacks. Tokenlon said that “imBTC transfers will be resumed after Tokenlon and partners are confident that it is secure to do so.” Users are advised to follow updates on the company’s Twitter page."

The country for this case study is not yet known.

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 - Uniswap ERC777 Reentrancy Attack
Date Event Description
April 28th, 2020 Main Event Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here.

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?

Total Amount Lost

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

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?

General Prevention Policies

More secure storage of funds would be offline storage with multiple signatures from trained individuals.

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