in the stakeVested
function in FjordStaking.sol,
The function doesn't check if the stream has already been staked. This could allow a user to stake the same stream multiple times, artificially inflating their stake and earning more rewards than they should.
To fix this, you should add a check to ensure the stream hasn't been staked before:
This check should be added near the beginning of the function, after the initial validations.
This bug could lead to an exploitable situation where a user repeatedly stakes the same stream, unfairly earning more rewards and potentially draining the contract of funds. It's crucial to ensure each unique stream can only be staked once per user because
The function doesn't check if a stream has been previously staked.
Each stake increases newStaked
, newVestedStaked
, and the user's deposit receipt.
At epoch rollover, these values contribute to totalStaked
and totalVestedStaked
.
User obtains a valid Sablier stream of 1000 FJO tokens.
User calls stakeVested
with this stream ID multiple times in the same epoch.
Each call increases their stake without transferring additional tokens.
At epoch rollover, the user's inflated stake is counted in totalStaked
.
The user now earns disproportionate rewards based on this inflated stake.
This dilutes rewards for honest stakers and could drain the contract of rewards.
This exploit could significantly disrupt the fairness of the staking system, allowing malicious users to earn outsized rewards without additional risk or capital commitment. It undermines the entire reward distribution mechanism
Manual review
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.