the function _stake(address user_, uint256 poolId_, uint256 amount_, uint256 currentPoolRate_)
always transfers tokens from the msg.sender
and not the user
when staking in a private pool
private pools can only be managed by the protocol owner by calling the function
if the deposited is greater than the updated amount the difference is staked by calling the function _stake(address user_, uint256 poolId_, uint256 amount_, uint256 currentPoolRate_)
, however this function incorrectly transfers tokens from msg.sender
which can only be the owner essentially staking the owners tokens for other users
the impact of this vulnerability is loss of tokens to the protocol owner
manual audit
change the line IERC20(depositToken).safeTransferFrom(_msgSender(), address(this), amount_);
to IERC20(depositToken).safeTransferFrom(user_, address(this), amount_);
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.