1 Wei corner case can affect minted shares for fee amounts badly
In StakingPool.sol
contract while updating the strategy rewards the minted shares for the fee receivers shares are minted in following way:
It firstly checks the fee amount for safety and if it's higher or equal to staked amount it directly mint the shares for the receivers. But it's causing a vulnerability for 1 wei corner case. Total fee amount is calculated with following way and small precision loss is very likely in this kind of percentage calculations.
Due to small precision loss such as 1 wei. It can be lower than totalStaked amount with only 1 point difference and it will pass the security check.
Following calculation will mint extremely higher amount of shares. Both totalFeeAmounts and totalShares have their own decimal and dividing by 1 wei will cause extremely higher amount of shares. This will cause massive price drops for staked link tokens shares and loss of funds.
Manual review
Be sure total staked - total fee amounts is higher than 1e18.
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.