Description:
The Escrow::_withdrawFromEscrow
function contains a reentrancy vulnerability due to the order of operations in the code. Specifically, the function performs an external call to transfer tokens (safeTransferFrom) before updating the escrow state. This allows for a potential reentrant call back into the Bridge::withdrawTokens
function, which could result in unauthorized withdrawals or double-spending of tokens.
Impact:
If exploited, this vulnerability could allow an attacker to perform reentrant calls during the token withdrawal process. As a result, the attacker might withdraw the same token multiple times, leading to unauthorized access to tokens and possible loss of assets within the contract.
Proof of Concept:
In this scenario, the MaliciousContract re-enters the Bridge::withdrawTokens
function during the safeTransferFrom execution, exploiting the unupdated escrow state to perform unauthorized withdrawals.
Recommended Mitigation:
To prevent reentrancy update state before external call - Modify the Escrow::_withdrawFromEscrow
function to update the escrow state (i.e., _escrow[collection][id] = address(0x0)) before making the external safeTransferFrom call.
2.Use a "reentrancyGuard" - Add the nonReentrant modifier from OpenZeppelin’s library to the Bridge::withdrawTokens
function to prevent reentrant calls.
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.
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.