QuantAMM

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

Lack of Access control of initilaize function

Summary

The initialize function in QuantWeightedPool.sol lacks proper access control, leaving it vulnerable to continous calling and frontrunning attacks. This function sets critical initial parameters for the pool, such as asset weights, settings, moving averages, and oracle thresholds. Without access control, any external entity can invoke this function before the legitimate initializer, potentially misconfiguring the pool and disrupting its intended operation. This vulnerability compromises the security and integrity of the protocol, allowing malicious actors to exploit it for their benefit.

Vulnerability Details

In this code the initilize function is vulnerable to frontrunn attacks

function initialize(
int256[] memory _initialWeights,
PoolSettings memory _poolSettings,
int256[] memory _initialMovingAverages,
int256[] memory _initialIntermediateValues,
uint _oracleStalenessThreshold
) public initializer {
require(_poolSettings.assets.length > 0 && _poolSettings.assets.length == _initialWeights.length, "INVASSWEIG"); //Invalid assets / weights array
assets = _poolSettings.assets;
poolSettings.assets = new address[](_poolSettings.assets.length);
for (uint i; i < _poolSettings.assets.length; ) {
poolSettings.assets[i] = address(_poolSettings.assets[i]);
unchecked {
++i;
}
}
oracleStalenessThreshold = _oracleStalenessThreshold;
updateInterval = _poolSettings.updateInterval;
_setRule(_initialWeights, _initialIntermediateValues, _initialMovingAverages, _poolSettings);
_setInitialWeights(_initialWeights);
}

Impact

Invalid or malicious parameters could prevent the pool from functioning correctly, leading to stalled operations or incorrect calculations

Tools Used

Manual audit

Recommendations

Only the designated pool owner or admin will be able to call the initialize function

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.

Give us feedback!