The contract RAACHousePriceOracle has a vulnerability where the variable lastHouseId is used to track house price updates but can be overwritten if multiple requests are made before responses are received. This creates a risk where incorrect prices may be assigned to houses, leading to data corruption.
The lastHouseId variable is updated in the _beforeFulfill() function based on the requests:
However, if multiple requests are made before the corresponding responses arrive, lastHouseId gets overwritten, causing _processResponse() to update the wrong house:
Sends Request A:
_beforeFulfill() sets lastHouseId = 101
Oracle request is made
Sends Request B before Response A arrives:
_beforeFulfill() overwrites lastHouseId = 202
Oracle sends Response A (for House ID 101):
_processResponse() updates House 202 instead of 101, storing the wrong price.
Oracle sends Response B (for House ID 202):
_processResponse() updates House 202 correctly.
House 101 never gets updated.
Incorrect price updates: Houses may be assigned incorrect price data.
Data loss: Some houses may never receive the correct price update.
Manual Review
Instead of using a single global variable (lastHouseId), track house IDs per oracle request using a 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.