The LendingPool contract is vulnerable to undercollateralized borrowing due to a missing staleness check in the price oracle function. The contract fetches NFT prices without verifying if the data is recent, allowing users to borrow against outdated and potentially inflated collateral values.
2025-02-raac/contracts/core/pools/LendingPool/LendingPool.sol at main · Cyfrin/2025-02-raac
In the borrow()
function, the contract calculates the user's collateral value using:
The function getUserCollateralValue()
internally calls getNFTPrice(tokenId)
, which fetches the price from the oracle:
The function returns the last recorded price and timestamp but does not verify if the timestamp is recent.
Same here after checking the getLatestPrice(tokenId) call
2025-02-raac/contracts/core/primitives/RAACHousePrices.sol at main · Cyfrin/2025-02-raac
Users can borrow more than allowed, leading to undercollateralization.
Validate timestamp before using collateral value:
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.