code-423n4 / 2023-05-asymmetry-mitigation-findings

2 stars 2 forks source link

Mitigation Confirmed for NEW #8

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Note: Issue has not actually been resolved but for some reason I can't get my issues to submit without "Mitigation confirmed (no new vulnerabilities detected)" checked so I am doing this as a work around

Severity

Medium

Lines of code

https://github.com/asymmetryfinance/smart-contracts/pull/209/files#diff-6abc8f2e4ad1647a12784e9fbf18e9c5f86c05668e3e89e2a51ab569992b214fR146-R149

Impact

Chainlink can return stale price

Proof of Concept

function ethPerDerivative() public view returns (uint256) {
    (, int256 chainLinkRethEthPrice, , , ) = chainLinkRethEthFeed
        .latestRoundData();
    return uint256(chainLinkRethEthPrice);
    return frxEthAmount;
}

Reth.sol now utilizes the Chainlink oracle to pull the current price of reth. The issue is that the returned values are not fully validated allowing the contract to consume stale price data.

Tools Used

Manual Review

Recommended Mitigation Steps

Store the updatedAt return value and confirm that the data is fresh enough.