Invalid lastPoolUpdateRun
Set by Malicious Pool Owner Causes Denial of Service
The InitialisePoolLastRunTime
function in UpdateWeightRunner
contract can be called by pool admin to set the lastPoolUpdateRun
timestamp for a pool.
With no validation on validity of provided timestamp, a future timestamp could be set which will cause the performUpdate
function to revert
The InitialisePoolLastRunTime
function allows setting an arbitrary timestamp for lastPoolUpdateRun:
If lastPoolUpdateRun
is set to a timestamp in the future, then block.timestamp - settings.timingSettings.lastPoolUpdateRun
will go negative that results in a failure in performUpdate
function.
This vulnerability particularly affects pools where the pool creator is untrusted. As stated documentation, scenarios where pool creators manipulate pool operations are considered in-scope.
If a future timestamp is set for lastPoolUpdateRun
, the pool will be unable to process updates until the blockchain's timestamp catches up. This means the pool's weights won't adjust as intended, which can result in incorrect pricing, increased impermanent loss for liquidity providers, and opportunities for malicious attackers
Also, it gives malicious pool owners the ability to control when updates occur, potentially disrupting the pool's performance and harming LPs.
Manual Review
To prevent this issue, ensure that the timestamp provided in the InitialisePoolLastRunTime
function is not set in the future.
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.