Core Contracts

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

Missing Check for Maximum Amount or Insufficient Balance in `Treasury::allocateFunds` function

Summary

The allocateFunds function lacks a validation check to ensure that the allocated amount does not exceed a predefined maximum limit or the allocator’s available balance. This could allow allocations of unrealistically high amounts, potentially leading to accounting inconsistencies, misallocation of funds, or denial-of-service scenarios.
`

Vulnerability Details

The vulnerability lies in the following part of the allocateFunds function:

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 function does not enforce a maximum limit on the amount that can be allocated. This could allow an allocator to allocate an excessively large amount, potentially disrupting the protocol's accounting or leading to unintended behavior.
The function does not verify whether the allocator has sufficient balance or authority to allocate the specified amount.

Impact

  • Allocating excessive amounts or exceeding available balances could disrupt the protocol's accounting and allocation mechanisms.

  • Misallocated funds might not be recoverable or could cause unexpected failures when attempting disbursement

Tools Used

Manual Code Review

Recommendations

  1. Define a MAX_ALLOCATION limit and ensure that amount does not exceed it.

  2. If allocations are tied to actual balances, check that msg.sender has sufficient balance before allocation.

Updates

Lead Judging Commences

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

Treasury::allocateFunds doesn't say what token you are actually allocating, doesn't check balances, or existing allocations to other recipients

Support

FAQs

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