All the update rule contracts i.e., AntiMomentumUpdateRule, ChannelFollowingUpdateRule, DifferenceMomentumUpdateRule, MinimumVarianceUpdateRule, MomentumUpdateRule, and PowerChannelUpdateRule has a common internal function called _getWeights which is used to calculate and forward calculated new weights to their callers. Function however, missing a _parameters argument values validation, _parameters is a 2D array of int256 type which contains important values for weights calculations.
*UpdateRule::_getWeights: (we have this function which has almost all or similar definition and declaration (signature)).
DoS
Array Length Mismatches
Service Disruption
lack of Invalid or malicious parameters sanitization
Pool Instability
etc
I know you would say it's a Caller input validation but IMO, internal functions should at least contain args sanitization check in order to be double ensured about protocol's functionality stability.
Manual review
If we inspect all the update rule contracts we'll found that there's also an external function named validParameters which returns a boolean after validating parameters and this function is made for exaclty parameters argument sanitization but the issue is, this function is only externally available.
So we can modify validParamters function's visibility and can use it in _getWeights function to validate _parameters arg.
*UpdateRule::validParameters:
*UpdateRule::_getWeights:
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.