sherlock-audit / 2024-10-ethos-network-judging

0 stars 0 forks source link

s0x0mtee - Deleted addresses can reregister themselves and can also register other addresses #242

Open sherlock-admin3 opened 3 weeks ago

sherlock-admin3 commented 3 weeks ago

s0x0mtee

High

Deleted addresses can reregister themselves and can also register other addresses

Summary

registerAddress() does not implement a check against compromised addresses appropriately, therefore they can call and successfully execute the function on their address. The only relatively close check for a compromised address in registerAddress() is https://github.com/sherlock-audit/2024-10-ethos-network/blob/main/ethos/packages/contracts/contracts/EthosProfile.sol#L386-L390 This is because users are intended to still be able to reregister deleted addresses but the logic doesn't have enough constraint to stop deleted/compromised wallets from reregistering themselves to the profile. The check above fails to stop this because profileIdByAddress[addressStr] != profileId is false since deleted addresses are only removed from the associated profile's addresses array but not deleted from profileIdByAddress struct.

Root Cause

Internal pre-conditions

  1. The address has to have been previously registered

External pre-conditions

  1. The address needs to be compromised by an attacker

Attack Path

  1. Compromised wallet calls registerAddress() with the appropriate arguments.

Impact

PoC

No response

Mitigation