The _withdrawFromEscrow function within Starklane contract is responsible for withdrawing tokens from escrow and transferring them to a designated address. However, the function currently does not follow the Checks-Effects-Interactions (CEI) pattern, which is critical for preventing reentrancy attacks.
The _withdrawFromEscrow function includes external calls to ERC721 or ERC1155 contracts through the safeTransferFrom method before updating the internal escrow state (_escrow[collection][id]).
This order of operations exposes the function to reentrancy attacks, as it violates the CEI pattern.
Manual Review
To mitigate the reentrancy risk, the _withdrawFromEscrow function should be modified to adhere to the CEI pattern or apply a nonReentrant modifier (e.g., from OpenZeppelin’s ReentrancyGuard) to ensure the function cannot be re-entered during execution.
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.