100e18 Fjord Points are distributed each epoch (weekly) to stakers in the protocol. Since there are no fees or timelock associated with staking in order to receive a portion of these rewards, a malicious user can sandwich the distribution.
Whenever a user stakes or unstakes in the FjordStaking.sol
contract, it invokes the FjordPoints.sol
contract to also keep count of a user's stake:
On each stake/unstake there are 2 modifiers:
checkDistribution
to check if the epoch timer has passed and it's time to distribute epoch rewards for the week
updatePendingPoints
to update any pending user points
The issue is that since there are no fees associated, nor a minimum amount of time required to stake in order to receive rewards, a malicious user can sandwich the tx that distributes the weekly epoch rewards and unfairly steal rewards. Not only is the protocol deploying on mainnet so MEV is possible, but the exact time at which the rewards are distributed each week is also easy to figure out:
Attack would be such:
Malicious user calculates the timestamp at which the weekly rewards are distributed
They see the transaction to distributePoints()
Sandwich the tx by staking as much as they can and steal rewards distribution
Although FjordStaking.sol
has a cooldown period of 3 epochs before you can unstake, epochs between the 2 contracts are not synchronized (according to developers), which means that any time they are NOT perfectly synchronized to the second, an attacker can pull this off.
Sandwich of epoch rewards distribution.
Manual review
Minimum amount of time needed to be staked in order to be eligible for rewards is one I can think of.
Impact: High - Users are getting an unreasonable amount of points through exploiting a vulnerability Likelihood: Low - Most of the times, when using the script, all deployment tx will get processed in the same block. But, there is a small chance for them to be processed in different blocks.
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.