A failed Compound can cause a DOS to pretty much the entire system. The reason for this is because of the status set in processCompoundCancellation
which is the last function called in the user flow where a compound action initiated by the Keeper fails for some reason.
There could be many reasons for this - for example, a lack of liquidity which incurs much bigger slippage than what we want as a system, resulting in failed token swap and failed compound action. The system is expected to handle such cases without bricking other functionality.
Let's see the code of processCompoundCancellation
in GMXCompound.sol:
As you can see, the status is set as Compound_Failed
. I won't get into detail on how we end up using this function as the report will get very long but this is basically the last function that gets called if the keeper tries to "compound" and the compounding fails. The whole flow can be easily checked in the detailed sequence diagrams made by the SteadeFi team.
Setting the status as Compound_Failed
bricks the functionality of very important functions like deposit
, withdraw
, and rebalance
.
Check before a deposit:
Check before a withdraw:
Check before a rebalance:
As you can see, these primary functions will be completely bricked because the status is not Open. The sponsor confirmed that the keepers will likely try to compound once a day, meaning this DOS can last days at a time making the system basically useless.
The only way to fix the DOS is if we manage to successfully process a compound which sets the status again to open:
However, this might not be possible immediately and the keepers likely won't try to compound again leaving the system DOSed for an undefined amount of time.
Additionally, according to the sequence diagram, it looks like we expect the status to be Open after processCompoundCancellation
:
Screenshot
DOS of the most important functions in the protocol which could continue for days.
That is not intended behavior and will lead to frustrated users and eventually to losses for the protocol.
Manual review
Set the status to open even if the compound failed:
self.status = GMXTypes.Status.Open;
Impact: High Likelihood: Low The sponsor confirmed it's a typo in the diagram but the documentation/source is the source of truth for the hawks. Will group all findings pointing out the wrong status transition to Compound_Failed based on the diagram.
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.