Closed sherlock-admin closed 1 year ago
minhtrng
medium
Lack of staleness check in Kept.
There is no staleness check in Kept._etherprice:
Kept._etherprice
(, int256 answer, , ,) = ethTokenOracleFeed().latestRoundData(); return UFixed18Lib.from(Fixed18Lib.ratio(answer, 1e8)); // chainlink eth-usd feed uses 8 decimals
common issue, example submission for reference
wrong ether price used when paying keepers
https://github.com/sherlock-audit/2023-07-perennial/blob/main/root/contracts/attribute/Kept.sol#L62-L63
Manual Review
Read the updatedAt parameter from the calls to latestRoundData() and verify that it isn't older than a threshold.
Duplicate of #159
2 comment(s) were left on this issue during the judging contest.
141345 commented:
d
n33k commented:
unhandled stale price returned from latestRoundData()
minhtrng
medium
Lack of staleness check in Kept
Summary
Lack of staleness check in Kept.
Vulnerability Detail
There is no staleness check in
Kept._etherprice
:common issue, example submission for reference
Impact
wrong ether price used when paying keepers
Code Snippet
https://github.com/sherlock-audit/2023-07-perennial/blob/main/root/contracts/attribute/Kept.sol#L62-L63
Tool used
Manual Review
Recommendation
Read the updatedAt parameter from the calls to latestRoundData() and verify that it isn't older than a threshold.
Duplicate of #159