The validParameters function in AntiMomentumUpdateRule.sol contains a critical validation flaw where it fails to properly validate the denominator type parameter (_parameters[1][0]). The function only validates that values are positive but doesn't enforce the specific requirements for the denominator type parameter, potentially leading to incorrect weight calculations in the pool.
The validParameters() function has insufficient validation logic for its parameters structure:
The function:
Checks if _parameters.length is 1 or 2
If length is 2, checks if _parameters[1].length == 1
Only validates that values in _parameters[0] are positive
Does not validate the specific value requirement for _parameters[1][0]
Based on the test file QuantAMMAntiMomentum.t.sol, the parameters should follow this structure:
parameters[1][0] is supposed to be 0 or 1, but in current implementation it can be set to any number.
Manual review
Add validation for parameters[1][0].
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.