The MomentumUpdateRule contract contains inadequate validation for the kappa parameter in its validParameters function. This could allow malicious or erroneous inputs to affect the weight calculations of the pool, potentially leading to economic vulnerabilities or system instability.
This validation is insufficient as it only checks if kappa values are greater than zero, without implementing proper bounds checking or considering the impact of extreme values on the weight calculations.
The vulnerability can manifest in several ways:
Economic Impact Scenario:
An attacker could input extremely large kappa values that pass the basic validation
These values would be used in the weight calculation formula: w(t) = w(t − 1) + κ · ( 1/p(t) * ∂p(t)/∂t − ℓp(t))
This could result in extreme weight adjustments, potentially leading to:
Unintended asset allocation
Market manipulation opportunities
Destabilization of pool economics
Technical Impact:
Large kappa values could cause numerical instability
Potential overflow in calculations despite using PRBMath
Unexpected behavior in weight updates affecting pool balance
Example Attack Scenario:
Attacker identifies the lack of upper bounds in kappa validation
They input a very large kappa value that passes the > 0
check
This causes extreme weight adjustments in the _getWeights
function
Pool weights become severely imbalanced
Attacker exploits this imbalance for financial gain
Manual code review
Implement proper bounds checking for kappa values:
Add parameter interdependency validation:
Validate kappa array length matches pool assets
Implement reasonable bounds based on economic models
Add checks for parameter relationships
Consider implementing emergency controls:
Add ability to pause weight updates if extreme values are detected
Implement gradual weight adjustment limits
Add monitoring for unusual weight changes
Add documentation specifying safe parameter ranges and their economic implications
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.