code-423n4 / 2024-02-althea-liquid-infrastructure-findings

3 stars 1 forks source link

`addManagedNFT()` - Due to how the adding of new NFT contract instances works, can add same LI NFT contract address more than once to the `ManagedNFTs` array. #745

Closed c4-bot-2 closed 9 months ago

c4-bot-2 commented 9 months ago

Lines of code

https://github.com/code-423n4/2024-02-althea-liquid-infrastructure/blob/3adc34600561077ad4834ee9621060afd9026f06/liquid-infrastructure/contracts/LiquidInfrastructureERC20.sol#L347-L353

Vulnerability details

There are no checks to ensure same LI NFT contract cannot be added more than once:

    function addManagedNFT(address nftContract) public onlyOwner { 
        LiquidInfrastructureNFT nft = LiquidInfrastructureNFT(nftContract);
        address nftOwner = nft.ownerOf(nft.AccountId());
        require(nftOwner == address(this), "this contract does not own the new ManagedNFT");
        ManagedNFTs.push(nftContract); 
        emit AddManagedNFT(nftContract);
    }

Impact:

Recommendation:

Assessed type

Invalid Validation

c4-pre-sort commented 9 months ago

0xRobocop marked the issue as duplicate of #149

c4-judge commented 8 months ago

0xA5DF marked the issue as unsatisfactory: Overinflated severity