Description:
The stake()
function lacks minimum stake time requirements, allowing malicious users to sandwich reward distributions. This is possible because:
Rewards are distributed in unstake
settleVaultsDebt()
which is publicly visible
A user can monitor the mempool for user unstaking or keeper calls to settleVaultsDebt()
User can then:
Example:
Impact:
Unfair reward distribution
Legitimate long-term stakers get less rewards
Proof of Concept:
lets walk through this attack path recalculateVaultsCreditCapacity
is a function that can be called to distribute rewards although is an internal function but is been called by other external functions such as settleVaultsDebt()
for example,
Now A Malicious actor can
Monitor mempool for settleVaultsDebt transaction
See user submitted tx
Frontrun with high gas stake() call
Get included in reward distribution
Backrun with unstake()
Recommended Mitigation:
include a vesting period mechanism
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.