Core Contracts

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

User can brick the `Treasury` by creating malicious ERC20 token

Summary

User is able to create malicious ERC20 token with type(uint256).max token supply and deposit it.

Vulnerability Details

User can do the following attack:

  1. He creates an ERC20 token that can't be transferred out from the Treasury (by overriding transfer or update function). This token should have a total supply of type(uint256).max

  2. Then he calls the Treasury::deposit function, transferring the whole total supply of this token to the Treasury

  3. This way the _totalValue variable is inflated to type(uint256).max and blocks any other user to deposit funds to the treasury

Impact

Total DoS of the Treasury

Tools Used

Manual review

Recommendations

Make a token whitelist in the Treasury

Updates

Lead Judging Commences

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

Treasury::deposit increments _totalValue regardless of the token, be it malicious, different decimals, FoT etc.

Support

FAQs

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

Give us feedback!