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

0 stars 0 forks source link

s0x0mtee - Deleted(Compromised) addresses can still invite users. #232

Open sherlock-admin2 opened 2 weeks ago

sherlock-admin2 commented 2 weeks ago

s0x0mtee

High

Deleted(Compromised) addresses can still invite users.

Summary

when deleteAddressAtIndex() is called on an address it removes it from the addresses array in that profile's struct and marks it as compromised ( isAddressCompromised[addressStr] = true;), but it inviteAddress() does not check if the inviter is compromised before granting permission to invite other users. It only checks if the invitee has been compromised with the checkIfCompromised(invitee) modifier. Hence even after a user has deleted a wallet that has been compromised the attacker can still invite other addresses to Ethos with the profile.

Root Cause

https://github.com/sherlock-audit/2024-10-ethos-network/blob/main/ethos/packages/contracts/contracts/EthosProfile.sol#L208-L217

Internal pre-conditions

  1. Address needs to have been previously registered to a previously existing profile
  2. The account gets compromised and gets deleted and labelled as compromised

External pre-conditions

  1. The address needs to be compromised by an attacker.

Attack Path

  1. The compromised/deleted address calls inviteAddress() with a clean/valid invitee address.

Impact

PoC

No response

Mitigation

consider adding the checkIfCompromised() modifier for the inviter and not just for the invitee in inviteAddress()