The RAACHousePrices oracle uses a single global lastUpdateTimestamp for all tokens. This means that whenever any token’s price is updated, the timestamp for every token is refreshed to the current time. As a result, tokens that haven't been updated recently may appear to have fresh prices, leading to misleading freshness data. This flaw can cause protocols relying on these timestamps to make decisions based on stale price data—potentially resulting in undercollateralized loans, inaccurate valuations, and other financial miscalculations.
Affected Code:
RAACHousePrices.sol
Link to code
Price Update Function:
Link to code
Issue Details:
Global Timestamp Issue:
The oracle uses one lastUpdateTimestamp for all tokens. Updating the price for any single token resets the timestamp for every token.
Misleading Data:
If a token's price has not been updated for an extended period, its data becomes stale. However, if another token is updated, the global lastUpdateTimestamp is refreshed, misleading any mechanism that checks for price freshness.
Exploit Scenario:
Example:
Token A's price was last updated 30 days ago (and is stale).
Token B is updated today, which resets lastUpdateTimestamp to today for both tokens.
Impact:
When a user queries Token A's price, the oracle returns the current timestamp, making it appear as if Token A's price is fresh. This can lead to erroneous price validations and potential borrowing against stale collateral.
Manual Review
Implement Token-Specific Timestamps:
Replace the global lastUpdateTimestamp with a mapping that tracks each token's last update:
Update the Price Setting Function:
Modify the setHousePrice function to update the timestamp for the specific token:
Adjust the getLatestPrice Function:
Ensure the function returns the token-specific timestamp:
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.