The access control mechanism in UpdateWeightRunner::calculateMultiplierAndSetWeightsFromRule()
is insufficient as it relies on a pool's self-registered rule address for authorization, which can be manipulated by any pool.
There are two key issues:
The function checks msg.sender == address(rules[params.poolAddress])
for authorization, but any pool can call setRuleForPool()
to register an arbitrary address as its rule. This means a malicious pool could:
Register a malicious contract as its rule
Use that contract to call calculateMultiplierAndSetWeightsFromRule()
Bypass the intended access control
The function checks poolRegistry()
directly from the pool contract instead of using the centralized approvedPoolActions
mapping. This allows pools to potentially manipulate their own registry flags.
The relevant code:
Manipulation of pool weights leading to:
Manipulate token ratios
Create arbitrage opportunities
Potentially drain pool funds through price manipulation
Manual review
Add rule address validation in setRuleForPool()
:
Use the centralized approvedPoolActions
mapping instead of calling poolRegistry()
:
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.