The RAACHousePrices
contract uses a global lastUpdateTimestamp
that gets overwritten each time any token's price is updated. This causes all previously updated token prices to incorrectly report their last update time as the most recent update time, potentially masking stale prices in the lending protocol's risk calculations.
In RAACHousePrices::setHousePrice
, the global lastUpdateTimestamp
is updated every time a token's price is set:
This means when getLatestPrice
is called, it returns the most recent update time of any token, not the specific time when the queried token's price was last updated.
Oracle updates token 1's price:
Oracle updates token 2's price:
LendingPool uses stale price without knowing:
Stale prices may be used in critical functions:
In LendingPool::getUserCollateralValue
, collateral could be overvalued
In LendingPool::withdrawNFT
, may allow withdrawals based on stale valuations
In LendingPool::calculateHealthFactor
, could delay liquidations using outdated prices
Manual review
Track update timestamps per token using a dedicated mapping:
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.