When executing UpdateWeightRunner::setWeightsManually there is no check for the length of the weights being equal to the number of assets. This function also verifies that the weight values are between 0 and 1e18, but only for the weights in the length of the number of assets, meaning that any other weight set beyond that doesnt have to conform to those limits.
In this example we provide 4 weights and number of assets is set to 3 "accidentaly", because of it this fourth weight can be set to >= 1e18
So in this example a pool of 4 assets ends up with its fourth asset's weight misconfigured beyond the maximum allowed amount.
This test can be added at the end of the tests in the UpdateWeightRunner.t.sol file
Misconfiguration in the pools weights
Manual review
Add a check at the start of the UpdateWeightRunner::setWeightsManually function to verify that _weights == _numberOfAssets * 2 similar to the require statement in QuantAMMWeightedPool.sol#L623
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.