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

Potential Token Loss Due to Unchecked ERC721 Transfer in Escrow Deposit

Summary

The _depositIntoEscrow function in the Starklane escrow contract does not verify the success of ERC721 token transfers, which could lead to tokens being lost or the escrow state becoming inconsistent.

Vulnerability Details

In the _depositIntoEscrow function (lines 26-53), the ERC721 token transfer is performed without checking its return value:

if (collectionType == CollectionType.ERC721) {
IERC721(collection).transferFrom(msg.sender, address(this), id);
} else {
// ERC1155 handling
}

The transferFrom function of some ERC721 implementations might not revert on failure but instead return a boolean indicating the success of the operation. By not checking this return value, the contract assumes the transfer was successful and updates the escrow state regardless of the actual outcome.

Impact

This vulnerability could lead to:

  1. Loss of user tokens if the transfer fails silently

  2. Inconsistent escrow state where the contract believes it holds tokens it doesn't actually possess

  3. Potential blocking of the bridging process for affected tokens

  4. Financial losses for users who believe their tokens are safely escrowed

  5. The severity is high due to the potential for direct financial loss and system state inconsistency.

Tools Used

Manual code review

Recommendations

Use OpenZeppelin's safeTransferFrom function instead of transferFrom for ERC721 tokens:

if (collectionType == CollectionType.ERC721) {
IERC721(collection).safeTransferFrom(msg.sender, address(this), id);
}

or instead you can decide to still use transferFrom but check the return value.

Updates

Lead Judging Commences

n0kto Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

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