Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@IkiliagwuC
Copy link

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;

@IkiliagwuC 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
@ghost
Copy link

ghost commented Aug 12, 2024

The solution is not good. You should use || operator.

@IkiliagwuC 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
@0xdeth 0xdeth added the invalid This doesn't seem right label Aug 17, 2024
@0xdeth
Copy link
Contributor

0xdeth commented Aug 17, 2024

Duplicate of #9.

@0xdeth 0xdeth added bug Something isn't working duplicate This issue or pull request already exists and removed invalid This doesn't seem right labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants