Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

OxZ00mer - No L2 sequencer check when getting ETH price for the sake of calculating keeper fees #146

Closed
sherlock-admin opened this issue Aug 15, 2023 · 2 comments
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Aug 15, 2023

OxZ00mer

medium

No L2 sequencer check when getting ETH price for the sake of calculating keeper fees

Summary

The lack of a sequencer uptime check allows for the use of a stale price for calculating keeper payouts.

Vulnerability Detail

In the case of sequencer downtime, the prices provided by the Chainlink ETH price feed can become outdated, paying the keepers out with outdated rates.

Impact

If ETH was to significantly move in price while the sequencer is down it will cause financial damage to the protocol.

Code Snippet

https://github.com/sherlock-audit/2023-07-perennial/blob/main/root/contracts/attribute/Kept.sol#L62

function _etherPrice() private view returns (UFixed18) {
  // @audit no L2 sequencer uptime check
  (, int256 answer, , ,) = ethTokenOracleFeed().latestRoundData();
	return UFixed18Lib.from(Fixed18Lib.ratio(answer, 1e8)); // chainlink eth-usd feed uses 8 decimals
}

Tool used

Manual Review

Recommendation

Consider using the following Chainlink feed to conduct a check for whether the L2 sequencer is down or not.

https://blog.chain.link/how-to-use-chainlink-price-feeds-on-arbitrum/#almost_done!_meet_the_l2_sequencer_health_flag

@sherlock-admin
Copy link
Contributor Author

2 comment(s) were left on this issue during the judging contest.

141345 commented:

m

n33k commented:

unhandled stale price returned from latestRoundData()

@arjun-io arjun-io added the Sponsor Disputed The sponsor disputed this issue's validity label Aug 22, 2023
@arjun-io
Copy link

Same reasoning as #159

@141345 141345 closed this as completed Aug 23, 2023
@hrishibhat hrishibhat removed the Medium A valid Medium severity issue label Aug 23, 2023
@sherlock-admin2 sherlock-admin2 changed the title Funny Pickle Cottonmouth - No L2 sequencer check when getting ETH price for the sake of calculating keeper fees OxZ00mer - No L2 sequencer check when getting ETH price for the sake of calculating keeper fees Aug 23, 2023
@sherlock-admin2 sherlock-admin2 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
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
Projects
None yet
Development

No branches or pull requests

5 participants