This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
0x73696d616f - Missing updatedAt
and recommended timeout checks in Kept.sol
fetched chainlink prices
#159
Labels
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
Comments
github-actions
bot
added
Medium
A valid Medium severity issue
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
labels
Aug 18, 2023
This was referenced Aug 18, 2023
n33k - Kept.sol: Keeper could be rewarded with wrong amount of token because of stale eth price
#122
Closed
2 comment(s) were left on this issue during the judging contest. 141345 commented:
n33k commented:
|
In the event that the price is stale, we should still use the price as it is he best approximation of what the incentive reward should be. If we instead revert (as per the recommendation) then the entire system will be fully blocked, even disallowing keepers who are willing to take a loss to keep the system running. |
This was referenced Aug 22, 2023
Closed
OxZ00mer - No L2 sequencer check when getting ETH price for the sake of calculating keeper fees
#146
Closed
sherlock-admin
changed the title
Original Tiger Panther - Missing
0x73696d616f - Missing Aug 23, 2023
updatedAt
and recommended timeout checks in Kept.sol
fetched chainlink pricesupdatedAt
and recommended timeout checks in Kept.sol
fetched chainlink prices
sherlock-admin
added
Non-Reward
This issue will not receive a payout
and removed
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
labels
Aug 23, 2023
This was referenced Nov 15, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
0x73696d616f
medium
Missing
updatedAt
and recommended timeout checks inKept.sol
fetched chainlink pricesSummary
PythOracle
incentivizes thekeeper
with an amount pro-rata to the ether price, fetched from a Chainlink oracle. When using chainlink prices, it's important to check that theupdatedAt
return value from thelatestRoundData()
call is different than 0. Additionaly, a timeout should be added after which theupdatedAt
value is no longer valid (not fresh enough).Vulnerability Detail
Here is a great article from 0xmacro explaining in detail these 2 important measures. The
updatedAt
value should be different than 0 and smaller than the current timestamp by only a hardcode timeout.Impact
The
keeper
is incorrectly incentivized and could incur in losses. Would place the system in a DoS state as no one would want to incur losses to update the oracle prices (or losses to the protocol team).Code Snippet
In
Kept.sol
, notice thekeep()
modifier and_etherPrice()
functions. There are no checks in the Chainlink answer (besides it being negative, as it would underflow when converted toUFixed18
).Tool used
Vscode, Hardhat, Manual Review
Recommendation
Add the following checks to
_etherPrice()
:The text was updated successfully, but these errors were encountered: