Coder Social home page Coder Social logo

scottliyq / defihacks_via_hardhat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zzzuhaibmohd/defihacks_via_hardhat

0.0 1.0 0.0 580 KB

In this repository, I try to perform a mainnet fork and then simulate popular smart contract exploits on various DEFI Protocols using Hardhat Framework.

JavaScript 100.00%

defihacks_via_hardhat's Introduction

defiHacks_via_Hardhat

1. Alchemix Access Control Bug

Any user could have called setWhitelist() to give an attacker the ability to call the harvest function or to call the flush function. While these two actions are relatively harmless, an attacker could also front-run the intended keeper addresses to block harvest() and flush() from being called, effectively causing a denial of service.

Reference - https://medium.com/immunefi/alchemix-access-control-bug-fix-debrief-a13d39b9f2e0

2. 88mph Function Initialization Bug

The init() function used to initialize the NFT contract on 88mph’s platform, was missing an onlyOwner modifier, and there was also no initializer modifier to prevent a re-initialization as well. This vulnerability would have allowed a malicious attacker to have access to any user’s NFTs and deposits via burn() and mint() functions.

Note: The blockNumber of the hardhat config is set a block where in one of the NFT was minted.

Reference - https://medium.com/immunefi/88mph-function-initialization-bug-fix-postmortem-c3a2282894d3

3. CoinstoreNFT Public Burn Bug

The burn() function present in the ERC721 standard which destroys the token and removes it from blockchain is missing proper access control. As a result, this function can be called by anyone.

Reference - https://twitter.com/BlockSecTeam/status/1543928537882714112

4. FlippazOne Missing Access Control

The ownerWithdrawAllTo() function is missing the onlyOwner modifier check. Additionally, the check of whether the auction is over is also missing. As a result, any user can call the function and drain all the funds. Be sure to check out the tweet linked below to understand more about what happend - when one of the user sent the transaction to the public mempool.

Reference - https://twitter.com/bertcmiller/status/1544496577338826752

Special Mentions

https://twitter.com/immunefi

https://twitter.com/AshiqAmien

defihacks_via_hardhat's People

Contributors

zzzuhaibmohd avatar

Watchers

James Cloos avatar

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.