QuantAMM

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

Zero oracle staleness threshold causes permanent pool DoS

Description

In UpdateWeightRunner._getData(), when oracleStalenessThreshold is 0, the oracle freshness check becomes oracleResult.timestamp > block.timestamp. Since oracles cannot provide future timestamps, this condition is impossible to satisfy, causing all oracle updates to fail and permanently DOS the pool.

uint256 oracleStalenessThreshold = IQuantAMMWeightedPool(_pool).getOracleStalenessThreshold();
if (oracleResult.timestamp > block.timestamp - oracleStalenessThreshold) { // @audit-poc With threshold=0, requires future timestamp
outputData[i] = oracleResult.data;
}

Pools can become permanently non-functional if staleness threshold is set to 0, as no oracle update can pass the timestamp validation.

Recommendation

Add validation in pool initialization:

require(oracleStalenessThreshold > 0, "Invalid staleness threshold");

Or modify the check to allow current block timestamps:

if (oracleResult.timestamp >= block.timestamp - oracleStalenessThreshold)
Updates

Lead Judging Commences

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas / Admin is trusted / Pool creation is trusted / User mistake / Suppositions

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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