TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

Possible Griefing via `stakeFor` using dust amount in `TempleGoldStaking`

Summary

In TempleGoldStaking, there's no minAmount to be staked. As a result, people could griefing others via stakeFor using dust amount. This can lead to the _accountLastStakeIndex being manipulated, causing inconvenience and bad user experience.

Vulnerability Details

Currently, there is no minAmount requirement for a staking. As a result, people could griefing others via stakeFor using dust amount.

This could manipulate the _accountLastStakeIndex of others with dust amount.

function stakeFor(address _for, uint256 _amount) public whenNotPaused {
if (_amount == 0) revert CommonEventsAndErrors.ExpectedNonZero();
// pull tokens and apply stake
stakingToken.safeTransferFrom(msg.sender, address(this), _amount);
uint256 _lastIndex = _accountLastStakeIndex[_for];
_accountLastStakeIndex[_for] = ++_lastIndex;
_applyStake(_for, _amount, _lastIndex);
_moveDelegates(address(0), delegates[_for], _amount);
}

The victims would find it harder to get to their own staking information, causing inconvenience and bad user experience.

function getAccountLastStakeIndex(address account) external override view returns (uint256) {
return _accountLastStakeIndex[account];
}

Impact

The victims would find it harder to get to their own staking information, causing inconvenience and bad user experience.

  • The manipulation of _accountLastStakeIndex through dust amounts can significantly inconvenience users by making it difficult to track their staking information accurately.

  • Although this vulnerability does not directly lead to financial loss, the potential for abuse and the negative impact on user experience can be significant. Malicious actors can exploit this loophole to disrupt the staking process for legitimate users.

Tools Used

Manual

Recommendations

Set a minAmount for staking to prevent dust amount griefing: implementing a minimum staking amount can effectively prevent the exploitation of dust amounts for griefing purposes. This ensures that only meaningful staking transactions are processed, maintaining the integrity of the staking index.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.