Core Contracts

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

user who has a ALLOCATOR_ROLE role can overwrite funds without adding it

Summary

users with the allocator_role can update the funds using the allocatefunds() function. however, since the existing allocated amount is unknown and is replaced by a new value, there is a possibility of mistakes or malicious manipulation

Vulnerability Details

function allocateFunds(
address recipient,
uint256 amount
) external override onlyRole(ALLOCATOR_ROLE) {
if (recipient == address(0)) revert InvalidRecipient();
if (amount == 0) revert InvalidAmount();
_allocations[msg.sender][recipient] = amount;
emit FundsAllocated(recipient, amount);
}

the allocatefunds() function does not update the existing fund amount by adding (+=), but simply overwrites it with =. if a user with fund update privileges makes a mistake, the existing funds could be overwritten

Impact

can easily cause the funds to be manipulated

Tools Used

code review

Recommendations

additionally, verification logic must be added.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Treasury::allocateFunds should increase or decrease funds to avoid recipient frontrunning and double spending

Support

FAQs

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