Reentrancy from _transferAndBurnFuses
#293
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate
This issue or pull request already exists
old-submission-method
Lines of code
https://github.com/code-423n4/2022-07-ens/blob/ff6e59b9415d0ead7daf31c2ed06e86d9061ae22/contracts/wrapper/NameWrapper.sol#L813-L822
Vulnerability details
Impact
Reentrancy attack
Proof of Concept
The function
_transferAndBurnFuses
is not performing Checks-Effects-Interactions pattern, and updates fuses after NFTs are transfered.An attacker can reenter because
_transfer
is performing a_doSafeTransferAcceptanceCheck
where it check the receive is able to handle NFTs.Recommended Mitigation Steps
Set the variables before transferring
[-] transfer(owner, newOwner, uint256(node), 1, "");
[-] _setFuses(node, newOwner, fuses, expiry);
[+] _transfer(owner, newOwner, uint256(node), 1, "");
The text was updated successfully, but these errors were encountered: