QuantAMM

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

Unlimited Backup Oracles and Duplicate Oracle Entries in UpdateWeightRunner

Summary

The setRuleForPool function allows an unlimited number of backup oracles to be configured and does not prevent duplicate oracle entries, which could lead to increased gas costs and potential DOS attacks during oracle updates.

Vulnerability Details

In the UpdateWeightRunner contract's setRuleForPool function, when validating oracle configurations, there is no limit on the number of backup oracles that can be added per token and no check for duplicate oracle addresses:

for (uint i; i < _poolSettings.oracles.length; ++i) {
require(_poolSettings.oracles[i].length > 0, "Empty oracles array");
for (uint j; j < _poolSettings.oracles[i].length; ++j) {
if (!approvedOracles[_poolSettings.oracles[i][j]]) {
revert("Not approved oracled used");
}
}
}

This means that:

  1. A malicious or careless pool manager could add an excessive number of backup oracles

  2. The same oracle address could be added multiple times as a backup

  3. During oracle updates, the contract would need to iterate through all backup oracles, potentially consuming excessive gas and blocking weight updates. (Imagine a pool with 1000 backup oracles of all the same oracle)

Impact

Gas Grief whoever updates weights making ti so that I a malicious pool manager has more control over when pools get updated.

Potential DOS - The lack of limits on backup oracles and duplicate checks could lead to:

  • Excessive gas consumption during oracle updates

  • Potential DOS if too many backup oracles are added

  • Unnecessary storage costs

  • Inefficient oracle fallback process

Tools Used

Manual Review

Recommendations

Validate the number of backup oracles is less then a set max and check for duplicates.

Updates

Lead Judging Commences

n0kto Lead Judge 10 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.