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

Upon the transfer of an escrowed NFT from the bridge to the user on StarkNet, the escrow status remains unaltered, failing to be reset

Summary

Upon the transfer of an escrowed NFT from the bridge to the user on Starknet, the escrow status remains unaltered, failing to be reset.

Vulnerability Details

bridge::withdraw_auto_from_l1

let is_escrowed = !self.escrow.read((collection_l2, token_id)).is_zero();
if is_escrowed {
IERC721Dispatcher { contract_address: collection_l2 }
.transfer_from(from, to, token_id);
} else {

From the code above, if is_escrowed is true, it indicates that the token is held within the bridge contract. However, when transferring the token out, the escrow status is not reset to zero. This does not align with the protocol logic, as once the token is withdrawn, it should be reset to signify that it is no longer in escrow.

Impact

The escrow status does not align with the actual circumstances.

Tools Used

manual

Recommendations

use starknet::contract_address_const;
let is_escrowed = !self.escrow.read((collection_l2, token_id)).is_zero();
if is_escrowed {
IERC721Dispatcher { contract_address: collection_l2 }
.transfer_from(from, to, token_id);
+ self.escrow.write((collection_l2, token_id), contract_address_const::<0>());
Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

finding-L2-withdrawing-do-not-clean-escrow-mapping

Impact: Incorrect state without any other impact, which deserves a Low according to CodeHawks documentation.

Appeal created

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-L2-withdrawing-do-not-clean-escrow-mapping

Impact: Incorrect state without any other impact, which deserves a Low according to CodeHawks documentation.

Support

FAQs

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

Give us feedback!