The ERC20ToGenerateNftFraccion contract has a public mint function without access controls, allowing any user to mint arbitrary amounts of tokens. This is particularly severe as this token represents fractional NFT ownership.
The vulnerability exists in the ERC20ToGenerateNftFraccion contract where the mint function lacks access control:
The mint function is declared as public without any access modifiers like onlyOwner, allowing any external account to call it and mint tokens at will.
Critical. This vulnerability has several severe implications:
Any user can mint unlimited tokens to any address
Token supply can be manipulated at will
The entire NFT fractionalization system can be compromised since token amounts no longer accurately represent NFT ownership shares
Economic attacks possible through unlimited minting
Copy this tests in path test/unit/ERC20ToGenerateNftFractionTest.t.sol
Two test cases demonstrate the vulnerability:
Output shows successful unauthorized minting:
Output demonstrates complete supply manipulation:
The test outputs clearly show:
An attacker starting with 0 balance can mint arbitrary amounts
Tokens can be minted to any address
The total supply can be manipulated to reach maximum uint256 value
No transactions revert, indicating complete lack of access controls
Manual review and foundry
Implement two-step ownership transfer access control using OpenZeppelin's Ownable2Step:
Any person can mint the ERC20 token generated in representation of the NFT
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.