While keepers are currently centralized the intention has been stated to make them decentralized down the road (Link). There is an attack vector that allows a keeper to steal funds from the protocol.
In GMXVault:compound
There is no input validation for GMXTypes.CompoundParams
. The malicous keeper can pass in any ERC20 token with 0 balance in the vault, which will bypass the logic in the if-statement. This will simply cause GMXVault:compound
to transfer tokens from the trove to the vault.
Since bypassing the if-statement also bypasses the status check in beforeCompoundChecks
, the transfer from the trove to the GMXVault can be executed at any time. If a malicious keeper times this compound
call inbetween GMXWithdraw:withdraw
and GMXWithdraw:processWithdraw
he can transfer the tokens from the trove to himself as processWithdraw
transfers all tokens A/B of the contract to the user:
A malicous keeper is capable of stealing funds from the trove
Manual Review and Discussion with Team on Discord
Options:
remove the if (_tokenInAmt > 0)
check
Perform the status check that happens in beforeCompoundChecks
at the beginning of GMXCompound:compound
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.