Giter Club home page Giter Club logo

tether-vulnerability-in-the-transferfrom-function's Introduction

Tether vulnerability in the transferFrom function

The original smart contract code has been changed to simplify deployment.

Vulnerability

The vulnerability lies in the code below. It allows anyone to move anyone else's funds to an address that is trusted. It is understood that the trusted address can be a popular DeFi smart contract such as Uniswap Router. The attacker will not be able to take possession of the funds, but he will be able to move the funds of any users without permission.

if (isTrusted[_recipient]) {

Testing vulnerability in Goerli

Smart contract. UniswapV2Router02 as trusted smart contract. Victim. Attacker. Transaction with an attack - Funds from the address of the victim without permission are transferred by any user to the address of a trusted contract.

Fixing vulnerability

To fix the vulnerability, the function should be modified as follows. Because this function is called by the trusted smart contract itself. The trusted caller of this function is the spender, not the recipient.

if (isTrusted[_msgSender()]) {

Smart contracts

Tether USD (USDT), Euro Tether (EURT) and etc in various EVM-based blockchains with isTrusted functionality. One of them:

tether-vulnerability-in-the-transferfrom-function's People

Contributors

an-ivannikov avatar

Watchers

 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.