QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Lack of Timestamp Check in Chainlink _getData() Function

Summary

The code that retrieves price data from Chainlink (_getData()) does not verify how recent (i.e., not stale) the returned information is. The function simply obtains the timestamp from the oracle without comparing it to block.timestamp or any “staleness threshold.” This absence of a check means the code could rely on outdated data which no longer reflects the current market situation, or potentially incorrect data (too old or too new) caused by node errors.

Vulnerability Details

In ChainlinkOracle, the _getData() function returns (data, timestamp) but does not include logic such as:

require(block.timestamp - timestamp <= stalenessThreshold, "Data too stale");

or

require(timestamp <= block.timestamp, "Timestamp error");

Omitting such checks makes it possible to use potentially stale (out-of-date) or incorrect data without detection.

Impact

The system may calculate subsequent steps (e.g., adjusting weights, allowing withdrawals, liquidity calculations, etc.) based on outdated prices, causing potential losses for the protocol or its users.

Tools Used

Manual

Recommendations

Ensure timestamp is not greater than block.timestamp (no “future” timestamps) to defend against erroneous or manipulated data.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

invalid_chainlink_staled_data_updateAt_roundId_known_issue

LightChaser: ## [Medium-4] Insufficient oracle validation

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.