NFTBridge
60,000 USDC
View results
Submission Details
Severity: high
Invalid

Potential DenialOfService(DOS) Attack found in Escrow contract

Summary

A Denial of Service (DoS) vulnerability was identified in the escrow contract's depositIntoEscrow function. The function fails to handle scenarios where a large number of ERC721 tokens are deposited into escrow, leading to potential resource exhaustion and contract failure.

Vulnerability Details

The vulnerability arises when an attacker attempts to deposit a large number of ERC721 tokens into the escrow contract in a single transaction. The contract does not impose any limit on the number of tokens that can be deposited at once, resulting in the contract trying to process all tokens simultaneously. This leads to excessive gas consumption, which can easily exceed the block gas limit.

Impact

This vulnerability allows an attacker to disrupt the functionality of the escrow contract by depositing an excessively large number of ERC721 tokens, leading to transaction reversion and potential contract unavailability. This could lock assets in the contract or prevent further interactions until the issue is resolved.

Tools Used

Manual Review

Proof of Concept (PoC)

function test_FailsIfTooManyIdsDeposited() public {
IERC721MintRangeFree(erc721).mintRangeFree(alice, 0, 100000);
uint256[] memory ids;
for (uint256 i = 0; i < 100000; i++) {
ids[i] = i;
}
// Depositing a large number of arrays into escrow
vm.prank(alice);
escrow.depositIntoEscrow(CollectionType.ERC721, erc721, ids);
}

Recommendations

  • Implement a Limit on Deposits: Introduce a maximum limit on the number of tokens that can be deposited into escrow in a single transaction. This will prevent excessive gas consumption and reduce the risk of hitting the block gas limit.

  • Batch Processing: Consider implementing a batch processing mechanism where large numbers of tokens are processed in smaller batches over multiple transactions, ensuring that each transaction stays within the gas limit.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope

Support

FAQs

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