Giter Club home page Giter Club logo

reentrancy-attacks's Introduction

⚔️ A Historical Collection of Reentrancy Attacks

👮‍♂️ Sanity checks License: AGPL-3.0-only

📌 Definition of a Reentrancy Attack

Unsafe external call(s) that allow(s) malicious manipulation of the internal and/or associated external contract state(s).

📚 Types of Reentrancy Attacks

  • Single-Function Reentrancy
  • Cross-Function Reentrancy
  • Cross-Contract Reentrancy
  • Cross-Chain Reentrancy
  • Read-Only Reentrancy

📜 Reentrancy Attacks List

A chronological and (hopefully) complete list of reentrancy attacks to date.

Some of the exploits carried out involve multiple separate transactions as well as multiple victim and exploit contracts. For each attack, I have listed the most affected victim contract, the most critical exploit contract, and the most devastating exploit transaction.

💢 Disclaimer

Footnotes

  1. To prevent the article from constantly reloading, deactivate JavaScript in your browser.

  2. We list the attacker's address here for the sake of completeness, but technically the attack was executed with a Near-specific transaction type called "Batch Transaction" and not with a specific exploit contract.

  3. We list the victim contract, the exploit contract, and the exploit transaction on Arbitrum. However, the same exploit was carried out on Optimism with almost the same amount of loss: Victim contract, Exploit contract, Exploit transaction.

  4. The same exploit hit another victim with almost the same amount of loss: Victim contract.

  5. The same exploit hit two other victims with almost the same amount of loss: Victim contract 2, Victim contract 3.

  6. We list the victim contract, the exploit contract, and the exploit transaction on Optimism. However, the same exploit was carried out on Ethereum, albeit with a smaller loss amount: Victim contract, Exploit contract, Exploit transaction.

  7. We list the victim contract, the exploit contract, and the exploit transaction on Polygon. However, the same exploit was carried out on Ethereum, albeit with a smaller loss amount: Victim contract, Exploit contract, Exploit transaction.

  8. The technical post-mortem on the reentrancy lock vulnerability from Vyper can be found here.

reentrancy-attacks's People

Contributors

goncalomagalhaes avatar pcaversaccio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reentrancy-attacks's Issues

🔎 Reference Data to Attacks Listed

Reference attack data sets

(incomplete, but can make it complete if you would like to add it)

This is sourced from https://github.com/uni-due-syssec/sereum-results/blob/v2/contracts.md.

here is the entire list in csv format if you would like to add it

Earliest Reentrancy Attacks

Name Address Count Percentage Attack Codehash First Block with Attack Last Block with Attack
DSEthToken 0xd654bdd32fc99471455e86c2e7f7d7b6437e9179 42 0.2 Yes 0x5030ef85cd4668380445bc7a67bfceb66555b98905aeebbfa4057ccc90fc5191 1680024 (2016-06-10) 1680353 (2016-06-10)
N/A 0xf01fe1a15673a5209c94121c45e2121fe2903416 1 0 Yes 0xd39b80a4f0a184363d79e89bc4d113538d91679321d35c2430ae8a2912b98340 1743596 (2016-06-21) 1743596 (2016-06-21)
TheDarkDAO 0x304a554a310c7e546dfe434669c62820b7d83490 174 0.84 Yes 0x6a5d24750f78441e56fec050dc52fe8e911976485b7472faac7464a176a67caa 1881284 (2016-07-14) 1911084 (2016-07-19)
? 0x7660727d3cb947e807acead927ef3ede24c4a18d 4 0.02 ? 0xe9435c1fa4d66d60c25546e8391c63b97251a46baa0c2eaf9f67a9e4344b2832 1956895 (2016-07-26) 2016761 (2016-08-05)
TheDAO 0xbb9bc244d798123fde783fcc1c72d3bb8c189413 2112 10.2 Yes 0x6a5d24750f78441e56fec050dc52fe8e911976485b7472faac7464a176a67caa 1718497 (2016-06-17) 2130764 (2016-08-24)
proxyCC (CC) 0x238f99a33f6a1c78187b5b0d645cb4606aebf9e3 38 0.18 No 0x3ccbb4d23c292d1f38b8bd3a4b0f3903c915fe1eb483cc2a2e07f0ac7253eae7 2753269 (2016-12-05) 3151437 (2017-02-09)
Spankchain(PaymentChannel) 0xf91546835f756da0c10cfa0cda95b15577b84aa7 8 0.04 Yes 0x46a8b25053a9cf565e3032a4e9348281eda7cc5f3837a3613aea7a3dd9b9d3c2 6467246 (2018-10-07) 7168364 (2019-02-03)
BlockchainCuties 0xd73be539d6b2076bab83ca6ba62dfe189abc6bbe 2597 12.54 No 0x9d9df1dc920c01efbd3ce3c17f6b1e8ee0185675511af5b5231ed5476eb4d7c3 7725341 (2019-05-09) 9064560 (2019-12-07)

Additional information

it may be helpful also to define re-entrancy:

Reentrancy: The untrusted external call allows the attacker to re-enter the target contract, thus making
it is possible to operate in an inconsistent internal state.

Types of Reentrancy

  • Delegate-based reentrancy
  • Cross-function reentrancy

📌First Ever Reentrancy Attack

The first reentrency attck was a whitehack attack by me against my first WETH deployment.

https://old.reddit.com/r/ethereum/comments/4nmohu/from_the_maker_dao_slack_today_we_discovered_a/

Here you can see me thank the researcher for pointing out this general class of issues, which made us realize our contract was vulnerable.

I can’t find it now because all the slockit websites have been deleted, but shortly after this post, TheDAO devs made a blog post boasting that their contract was not vulnerable.

It has been a repeated theme for the last 5 years that people take worse versions of what I or some other good-faith inventor come up with, attach a scam token, and try to erase history. Please help preserve this historical record that TheDAO disaster could have been averted, but people who pay to market tokens to retail are more concerned about a quick flip than they are about building sound systems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.