Reregistering an already deleted address is not implemented correctly
Summary
In 'EthosProfile.sol', a user can delete a registered address and can also reregister the same address again, but reregistering the address is not handled properly as the address is not deleted from the profiles[profileId].removedAddresses and also its compromised status is also not updated.
Root Cause
When a user deletes an address from their profile, its added to the profiles[profileId].removedAddresses list:
But when the user reregisters the address , its not removed from the removedAddresses list and its compromised status is also not set to false and the same address will have active and deleted status at the same time and cause issues
Impact
On reregistering an address to a profile it will have both active and deleted/compromised status.
Mitigation
In registerAddress() function add a check to see if its a reregistering scenario(either check if the address is present in profiles[profileId].removedAddresses or if the address is compromised) and if its true then remove the address from the removedAddresses list and set the isAddressCompromised[addressStr] to false:
LeFy
High
Reregistering an already deleted address is not implemented correctly
Summary
In 'EthosProfile.sol', a user can delete a registered address and can also reregister the same address again, but reregistering the address is not handled properly as the address is not deleted from the
profiles[profileId].removedAddresses
and also its compromised status is also not updated.Root Cause
When a user deletes an address from their profile, its added to the
profiles[profileId].removedAddresses
list:Repo Link
The user can reregister once deleted address by calling the registerAddress():
Repo Link
But when the user reregisters the address , its not removed from the removedAddresses list and its compromised status is also not set to false and the same address will have active and deleted status at the same time and cause issues
Impact
On reregistering an address to a profile it will have both active and deleted/compromised status.
Mitigation
In registerAddress() function add a check to see if its a reregistering scenario(either check if the address is present in
profiles[profileId].removedAddresses
or if the address is compromised) and if its true then remove the address from the removedAddresses list and set the isAddressCompromised[addressStr] to false: