The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

LiquidationPool:decreasePosition update Value After Transfer.

Summary

In decreasePosition when we transfer the value either tstToken or euroToken in contract their is very common and well know issue , which is first external call then update the values which make it variable to security issues , like Reentrancy.

Vulnerability Details

Reentrancy which allow user to take some token amount more then he own.

You can clearly see you make external call then you update the storage in secure case it should update first then it will transfer amount , to secure future security isseus.

            // @audit-info renterency attack  maybe occur please  update stated before transfer the amount
            IERC20(TST).safeTransfer(msg.sender, _tstVal);
            positions[msg.sender].TST -= _tstVal;
        }
        if (_eurosVal > 0) {
            // @audit-info renterency attack  maybe occur please  update stated before transfer the amount

            IERC20(EUROs).safeTransfer(msg.sender, _eurosVal);
            positions[msg.sender].EUROs -= _eurosVal;
        }

Impact

Maybe withdraw all token from then contract which happen in past with many contracts.

Tools Used

myth and manual Review

Recommendations

Update storage then transfer the amount.

Updates

Lead Judging Commences

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!