Wrong address added to the removedAddresses array field of the profile data
Summary
When an address is removed from a profile it is added to the removedAddresses field of the profile data for historical tracking. However, the address added to the removedAddresses array is not the address being removed.
heeze
High
Wrong address added to the removedAddresses array field of the profile data
Summary
When an address is removed from a profile it is added to the removedAddresses field of the profile data for historical tracking. However, the address added to the removedAddresses array is not the address being removed.
Root Cause
Wrong address is added to the removedAddress array field of the profile data when deleting an address from a profile. https://github.com/sherlock-audit/2024-10-ethos-network/blob/main/ethos/packages/contracts/contracts/EthosProfile.sol#L591
Internal pre-conditions
External pre-conditions
No response
Attack Path
registerAddress
to register account B to their profileregisterAddress
to register account C to their profiledeleteAddressAtIndex
with the index of account B to remove it from their profileImpact
The addresses in the removedAddresses array for a profile will be incorrect, leading to wrong data being returned and used off-chain.
PoC
Mitigation
Add the correct address being removed to the removedAddresses array