You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deth_ctf - codeHash check in deployVault does not correctly check for non-empty address, malicious user can self-destruct 1 wei to prevent an account from creating a vault forever.
#28
Open
IkiliagwuC opened this issue
Aug 12, 2024
· 2 comments
Description of the Bug: In the deployVault function users can deploy vaults to a computeAddress, a malicious user can compute anothers user's Vaultaddress, and forcefully(self-destruct) send 1 wei to the computed address to lock the user out of the protocol vault creation forever .
Because the check vaultAddress.codehash != bytes32(0) fails even if the vault has not been deployed but contains some ether(as little as 1 wei).
Impact: Users can be locked out of vault creation forever at very little expense by attacker(1 wei)
Solution: add this check if (vaultAddress.codehash != bytes32(0)) && vaultAddress.codehash != keccak256("") return VaultAlreadyDeployed;
The text was updated successfully, but these errors were encountered:
IkiliagwuC
changed the title
codeHash check in deployVault does not correctly check for non-empty address
deth_ctf - codeHash check in deployVault does not correctly check for non-empty address
Aug 12, 2024
The solution is not good. You should use || operator.
IkiliagwuC
changed the title
deth_ctf - codeHash check in deployVault does not correctly check for non-empty address
deth_ctf - codeHash check in deployVault does not correctly check for non-empty address, malicious user can self-destruct 1 wei to prevent an account from creating a vault forever.
Aug 12, 2024
Description of the Bug: In the deployVault function users can deploy vaults to a computeAddress, a malicious user can compute anothers user's Vaultaddress, and forcefully(self-destruct) send 1 wei to the computed address to lock the user out of the protocol vault creation forever .
Because the check
vaultAddress.codehash != bytes32(0)
fails even if the vault has not been deployed but contains some ether(as little as 1 wei).Impact: Users can be locked out of vault creation forever at very little expense by attacker(1 wei)
Solution: add this check if (vaultAddress.codehash != bytes32(0)) && vaultAddress.codehash != keccak256("") return VaultAlreadyDeployed;
The text was updated successfully, but these errors were encountered: