`StrataxOracle.getPrice()` does not validate the `updatedAt` timestamp from Chainlink’s `latestRoundData()`, allowing the protocol to operate with arbitrarily stale prices that no longer reflect market conditions, leading to incorrect position calculations and potential loss of funds.
When retrieving price data from Chainlink oracles, the protocol should verify that the price is recent enough to be reliable. Chainlink price feeds can become stale during network congestion, oracle downtime, or when the price does not deviate enough to trigger an update.
In `StrataxOracle.getPrice()`, the function calls `latestRoundData()` which returns five values including `updatedAt` (the timestamp of the last price update). However, the function only checks that `answer > 0` and completely ignores `updatedAt`, `roundId`, and `answeredInRound`. A price that was last updated 24 hours ago is accepted the same as a price updated 1 second ago.
This stale price is then used in critical calculations in `calculateOpenParams()`, `calculateUnwindParams()`, and `_executeUnwindOperation()` to determine flash loan amounts, borrow amounts, and collateral withdrawal amounts.
Likelihood: Medium
Chainlink oracle downtime has occurred historically during extreme market events (e.g., LUNA/UST crash, network congestion events). During these events, `latestRoundData()` returns the last known price rather than the current market price
The protocol deploys on “all EVM-compatible chains with Aave V3, 1inch, and Chainlink deployed” — L2 sequencer downtime on chains like Arbitrum or Optimism causes stale prices without an L2 sequencer uptime feed check.
Impact: Medieum
Funds are directly at risk. A stale price that overvalues collateral allows the owner to open positions with more leverage than the actual market conditions support, creating positions that are immediately at risk of liquidation once the real price is used by Aave.
A stale price in `_executeUnwindOperation()` causes incorrect `collateralToWithdraw` calculations — either withdrawing too much collateral (degrading health factor of other positions) or too little (leaving funds stuck).
Commande For Run : forge test --mt testStalePriceAccepted --fork-url https://ethereum-rpc.publicnode.com -vvv
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.
The contest is complete and the rewards are being distributed.