Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Invalid

No Check to Prevent Self-Delegation in function delegateBoost() in BoostController.sol

Summary

The delegateBoost function does not prevent users from self-delegating their own boost (to == msg.sender). This could lead to unintended behavior, such as bypassing certain restrictions on delegation, exploiting reward mechanisms, or causing unnecessary storage writes.

Vulnerability Details

function delegateBoost( // @audit - check if it's reasonable to delegate boost to multiple addresses for same caller
address to,
uint256 amount,
uint256 duration
) external override nonReentrant {
if (paused()) revert EmergencyPaused();
>> if (to == address(0)) revert InvalidPool(); //@audit-info : No Check to Prevent Self-Delegation
if (amount == 0) revert InvalidBoostAmount();
if (duration < MIN_DELEGATION_DURATION || duration > MAX_DELEGATION_DURATION)
revert InvalidDelegationDuration();
uint256 userBalance = IERC20(address(veToken)).balanceOf(msg.sender);
if (userBalance < amount) revert InsufficientVeBalance();
UserBoost storage delegation = userBoosts[msg.sender][to];
if (delegation.amount > 0) revert BoostAlreadyDelegated();
delegation.amount = amount;
delegation.expiry = block.timestamp + duration;
delegation.delegatedTo = to;
delegation.lastUpdateTime = block.timestamp;
emit BoostDelegated(msg.sender, to, amount, duration);
}

Self-Delegation Not Restricted

  • The function allows users to delegate a boost to themselves (to == msg.sender).

  • There is no check ensuring to != msg.sender, which means users can delegate to their own address.

  • Potential Exploits

    • Reward Manipulation: If delegation affects voting power, rewards, or governance weight, a user could exploit self-delegation to artificially inflate influence.

    • Storage Bloat: Allowing self-delegation leads to unnecessary state updates, increasing storage costs and gas fees without meaningful changes.

    • Bypassing Delegation Restrictions: If delegation comes with cooldowns or other limitations, self-delegation could be used as a loophole to reset those restrictions.

Impact

Possible Miscalculation in External Reward Mechanisms : If there are reward systems or boost multipliers tied to delegated boosts, allowing users to delegate to themselves could: Trick the contract into thinking they have extra boost power. Inflate their personal stake or rewards without any real delegation.

Unnecessary Gas & Storage Usage: Self-delegation is redundant but still writes to storage, increasing contract execution costs.

Tools Used

Manual Review

Recommendations

function delegateBoost( // @audit - check if it's reasonable to delegate boost to multiple addresses for same caller
address to,
uint256 amount,
uint256 duration
) external override nonReentrant {
if (paused()) revert EmergencyPaused();
// Add a check
if (to == msg.sender) revert CannotSelfDelegate();
if (to == address(0)) revert InvalidPool();
....
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!