TempleGoldStaking::_rewardPerToken() is susceptible to frontrun attacks due to divison by totalSupply.
A malicious user could surveil the mempool for a distributeRewards() call, or any other call that distributes rewards(witdraw with boolean true for getting rewards etc.), whenever such transaction occurs the malicous user can frontrun by staking large amounts of tokens.
This way user could be griefed out of his staking rewards making them lesser than expected. Attack will not cost anything as the attacker could decide to proceed with the stake and even farm his rewards later, or just unstake later.
High
Manual review
Make calculations for _rewardPerToken not based on totalSupply, but on a individual parameter based on the user index.
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.