Lucene search

K
code423n4Code4renaCODE423N4:2023-09-ASYMMETRY-FINDINGS-ISSUES-11
HistorySep 25, 2023 - 12:00 a.m.

Stale cvx price can be used while depositing

2023-09-2500:00:00
Code4rena
github.com
1
stale price risk
deposit calculation
validation
chainlink data

7 High

AI Score

Confidence

Low

Lines of code
<https://github.com/code-423n4/2023-09-asymmetry/blob/main/contracts/strategies/votium/VotiumStrategy.sol#L32&gt;

Vulnerability details

Impact

Stale cvx price can be used while depositing

Proof of Concept

When user deposits, then price of afEth token is calculated. It’s needed to know how many tokens user will receieve.

This price consists of safEth price and vEth price.

This is how price is found for vEth.
<https://github.com/code-423n4/2023-09-asymmetry/blob/main/contracts/strategies/votium/VotiumStrategy.sol#L31-L33&gt;

    function price() external view override returns (uint256) {
        return (cvxPerVotium() * ethPerCvx(false)) / 1e18;
    }

Here, ethPerCvx function is called and false is passed as param. This param tells function if it’s needed to validate chainlink price. In case if it’s false then there will be no validation and as result there is a risk that chainlink will return stale price. As user also provides slippage that actually doesn’t mean that he will not be affected, it’s still possible that wrong price will fit slippage.

Tools Used

VsCode

Recommended Mitigation Steps

Validate chainlink data in this case.

Assessed type

Error


The text was updated successfully, but these errors were encountered:

All reactions

7 High

AI Score

Confidence

Low