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

PNS - Re-registering an address does not remove it from the compromised list #307

Open
sherlock-admin2 opened this issue Nov 4, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Nov 4, 2024

PNS

Medium

Re-registering an address does not remove it from the compromised list

Summary

The mechanism for removing connected addresses and adding them to the compromised list is to protect the profile from actions of this address on behalf of the profile. Additionally, if the user changes their mind, they can "restore" such an address to favor,
However, this does not remove it from the compromised list, but only from the deleted list, and thus such a list will continue to limit their actions in the system.

Root Cause

You can re-add a compromised address, but it is not removed from this list, only added to the profile's address list.

File: ethos/packages/contracts/contracts/EthosProfile.sol
  373:   function registerAddress(
  374:     address addressStr,
  375:     uint256 profileId,
  376:     uint256 randValue,
  377:     bytes calldata signature
  378:   ) external whenNotPaused onlyNonZeroAddress(addressStr) {


  386:     // you may restore your own previously deleted address,
  387:     // but you cannot register an address that has been deleted by another user
  388:     if (profileIdByAddress[addressStr] != profileId && isAddressCompromised[addressStr]) { //audit
  389:       revert AddressCompromised(addressStr);
  390:     }

  403:     profiles[profileId].addresses.push(addressStr); //audit: dodaje ten sam adres, który usunąłem i checkMaxAddresses() liczy go podwujnie bo jest i w usunietych i w aktywnych i zmniejsza nieslusznie limit userowi
  404:     profileIdByAddress[addressStr] = profileId;

  409:   }

EthosProfile.registerAddress

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Even though the address has been restored, it is still on the compromised list, which means that its access will continue to be limited.

PoC

No response

Mitigation

The address should be removed from the list of compromised addresses.

@sherlock-admin4 sherlock-admin4 changed the title Passive Mahogany Porpoise - Re-registering an address does not remove it from the compromised list PNS - Re-registering an address does not remove it from the compromised list Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant