DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Valid

A stale report could be validated by the `SettlementConfiguration::requireDataStreamsReportIsValid` function, leading to the potential use of outdated ask and bid prices in the `SettlementConfiguration::verifyOffchainPrice` function.

Summary

The lack of verification in the function SettlementConfiguration::requireDataStreamsReportIsValid to check if block.timestamp < premiumReport.observationsTimestamp could lead the function SettlementConfiguration::verifyOffchainPrice to return stale ask and bid prices.

Vulnerability Details

The function SettlementConfiguration::requireDataStreamsReportIsValid doesn't check if block.timestamp < premiumReport.observationsTimestamp. If premiumReport.validFromTimestamp + maxVerificationDelay > premiumReport.observationsTimestamp, the block.timestamp could be greater than premiumReport.observationsTimestamp, and the function wouldn't revert, thus validating a stale report:

premiumReport.validFromTimestamp
|
| maxVerificationDelay
|<---------------------------->
|
----------------x-------------x-------x----------------------> time
| now
|
premiumReport.observationsTimestamp

Impact

A stale report could be validated by the SettlementConfiguration::requireDataStreamsReportIsValid function, leading to the potential use of outdated ask and bid prices in the SettlementConfiguration::verifyOffchainPrice function.

Tools Used

Manual Review

Recommendations

It is recommended to add a verification to the if statement:

function requireDataStreamsReportIsValid(
bytes32 streamId,
bytes memory verifiedReportData,
uint256 maxVerificationDelay
)
internal
view
{
PremiumReport memory premiumReport = abi.decode(verifiedReportData, (PremiumReport));
if (
streamId != premiumReport.feedId
|| block.timestamp > premiumReport.validFromTimestamp + maxVerificationDelay
+ || block.timestamp < premiumReport.observationsTimestamp
) {
revert Errors.InvalidDataStreamReport(streamId, premiumReport.feedId);
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

There is a chance of consuming stale reports

Support

FAQs

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