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

Re-entrancy found in deposit function of Escrow.sol

Summary

The _depositIntoEscrow function is vulnerable to a reentrancy attack due to the lack of reentrancy protection. This flaw allows an attacker to exploit the function by calling it recursively during its execution, potentially withdrawing assets before the contract state is updated, leading to unauthorized access or double-spending of tokens.

Vulnerability Details

The _depositIntoEscrow function performs token transfers within a loop, depositing assets into escrow. However, the function does not implement any reentrancy guards. This omission means that during the execution of the function, particularly after the transferFrom or safeTransferFrom calls, an attacker could invoke another call to the function before the state is updated. By doing so, the attacker could repeatedly trigger the deposit process, manipulating the state to their advantage and potentially draining the escrow of assets.

Impact

Even though it don't directly effect the code , a successful reentrancy attack could allow an attacker to withdraw more tokens than they originally deposited, effectively draining the contract's funds. It is recommended to write code with a CEI(Checks Effects Interactions) Pattern always.

Tools Used

Manual Review.

Recommendations

  1. Use OpenZeppelin's Reentrancy Guard.

  2. Use Checks Effects Interactions Pattern in the codebase.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
Assigned finding tags:

finding-withdraw-reentrancy-creates-unbridgeable-tokens

Impact: - NFT already bridged won’t be bridgeable anymore without being stuck. Likelyhood: Low. - Attackers will corrupt their own tokens, deploying a risky contract interacting with an upgradable proxy. They have to buy and sell them without real benefits, except being mean. Some really specific and rare scenario can also trigger that bug.

Support

FAQs

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