Beautiful Tangerine Panther
High
Incorrect stale price validation will enable the use of outdated prices impacting financial computations
The incorrect condition in PythOracle.currentValue()
will cause inaccurate computations for users as outdated price data could be retrieved and used in financial operations.
In PythOracle.sol:29
, the condition price.publishTime < block.timestamp - noOlderThan
incorrectly validates stale price data, accepting outdated prices.
N/A
N/A
- A malicious or outdated oracle returns a stale price.
- The
currentValue()
function inPythOracle
accepts the stale price due to incorrect validation logic. - Dependent contracts such as
AutomationMaster
use the outdated price for financial calculations, leading to inaccurate exchange rates or validations.
The affected users or contracts relying on AutomationMaster
for exchange rates and validations suffer from incorrect computations, potentially leading to financial loss or failed transactions. The attacker does not directly gain, but the issue could cause systemic financial inaccuracies or exploitation scenarios.
Update the condition in PythOracle.sol:29
to ensure the timestamp is validated correctly:
require(price.publishTime >= block.timestamp - noOlderThan, "Stale Price");
require(price.publishTime < block.timestamp - noOlderThan, "Stale Price");
This change ensures only recent price data is accepted for financial computations.