In LiquidationPool::distributeAssets()
two Chainlink price feeds are used to return the latest price information for the assets being liquidated so that they can be distributed to eligible holders.
The issue arises from the lack of checks on the returned prices. They are accepted without any validation which is risky as incorrect / stale data can be returned. The data should be validated before being used as Chainlink may not be reliable where it struggles to establish a consensus from among it's sources at the beginning of a new round; where chain congestion or attacks on Chainlink means oracles are unable to submit and start a new round.
A further check is recommended if deploying the Arbitrum
chain where Chainlink recommends a check that the Arbitrum Sequencer
is live via the Sequencer Uptime Feed
.
If an incorrect value of 0
were returned by either of the chainlink price feeds; this would revert the entire liquidation transaction flow.
The sponsor acknowledges the distributeAssets()
function's dependency on non-zero price feed values in the audit's README.md
file.
If stale values are returned, i.e. an old value, it will result in incorrect asset valuations, i.e. in calculating the costInEuros
variable, in distributeAssets()
. An overvaluation or undervaluation means holders
can be sold assets at a lower or higher discount rate than the 9.09%
that it should be.
This breaks the functionality of the protocol as holders will lose a portion of their financial incentive for staking assets if assets are overvalued or they may receive undue rewards where assets are undervalued. This in turn affects the equilibrium between EUROs
and collateral
as if assets are overvalued, more EUROs are required to buy collateral.
Manual Review
Add zero value, stale value and roundId checks as below. For Arbitrum Sequencer check the linked code can be used https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.