code-423n4 / 2023-09-asymmetry-findings

2 stars 1 forks source link

AfEth.withdrawTime function works incorrectly #10

Open c4-submissions opened 1 year ago

c4-submissions commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-09-asymmetry/blob/main/contracts/AfEth.sol#L235

Vulnerability details

Impact

AfEth.withdrawTime will show wrong(likely longer time)

Proof of Concept

AfEth.withdrawTime function should show how many time user will need to wait to witdraw some amount of afEth token.

https://github.com/code-423n4/2023-09-asymmetry/blob/main/contracts/AfEth.sol#L234-L236

    function withdrawTime(uint256 _amount) public view returns (uint256) {
        return AbstractStrategy(vEthAddress).withdrawTime(_amount);
    }

As you can see function forwards amount to the vEthAddress.withdrawTime function. This is actually incorrect as user will not withdraw amount of vEth tokens, he will withdraw only part of it, that depends on ratio.

As result function will likely show bigger time to withdraw, which can create problems when another protocol will integrate afEth.

Tools Used

VsCode

Recommended Mitigation Steps

Calculate withdraw time only for part of _amount.

Assessed type

Error

toshiSat commented 1 year ago

valid, we should calculate withdrawTime with the vEth amount but not the afEth amount. It is a dupe and will mark later

elmutt commented 1 year ago

https://github.com/asymmetryfinance/afeth/pull/160

c4-judge commented 1 year ago

0xleastwood marked the issue as duplicate of #18

c4-judge commented 1 year ago

0xleastwood marked the issue as satisfactory

c4-judge commented 1 year ago

0xleastwood changed the severity to 3 (High Risk)

c4-judge commented 1 year ago

0xleastwood changed the severity to QA (Quality Assurance)

c4-judge commented 1 year ago

This previously downgraded issue has been upgraded by 0xleastwood

c4-judge commented 1 year ago

0xleastwood marked the issue as not a duplicate

c4-judge commented 1 year ago

0xleastwood changed the severity to QA (Quality Assurance)

c4-judge commented 1 year ago

This previously downgraded issue has been upgraded by 0xleastwood

c4-judge commented 1 year ago

This previously downgraded issue has been upgraded by 0xleastwood

c4-judge commented 1 year ago

0xleastwood removed the grade

c4-judge commented 1 year ago

0xleastwood changed the severity to QA (Quality Assurance)

c4-sponsor commented 12 months ago

elmutt (sponsor) confirmed