Unsorted external attesters cause the RegistryFactory
contract to be unable to create the account, as it fails to validate the given module since the non-compliant attesters[]
are used with the ERC-7484
.
The external attesters[]
of the RegistryFactory
contract are not guaranteed to be sorted when initialized in the constructor and are not sorted when the owner updates them via addAttester()
and removeAttester()
.
The external REGISTRY
compliant with the ERC-7484
and used in the isModuleAllowed()
function expects that the given external attesters[]
are sorted to interact with the REGISTRY.check()
.
ERC-7484 Required Registry functionality::
check
functions
" Theattesters
provided MUST be unique and sorted and the Registry MUST revert if they are not. "
This unsorted attesters[]
disrupts the createAccount()
flow by reverting when invoking isModuleAllowed()
to validate the given module and ensure all modules are whitelisted, resulting in the reversion in creating the Nexus
account using the RegistryFactory
contract.
The unsorted attesters[]
can cause the RegistryFactory
contract to revert when attempting to create a new account.
Although the trusted attesters are provided by the owner during the deployment phase, and the owner can compute and use sorted attester addresses before modification, the likelihood of this issue occurring is not considered low.
This is due to the arbitrary nature of address (20-bytes random) and the logic in the addAttester()
and removeAttester()
, which shows that there is no sorting logic present, making it highly likely for the attesters[]
array to become unsorted when modified.
Initial State:
Using the TrustManagerExternalAttesterList
contract as an example of the REGISTRY
contract compliant with ERC-7484
.
Step 1:
Deploy the RegistryFactory
contract and assign the attesters
as [0x101, 0x202, 0x303, 0x404, 0x505]
(SORTED).
Step 2:
Owner removes 0x101
attester => the new attesters become **UNSORTED **= [0x505, 0x202, 0x303, 0x404]
(the unsorted logic also arises in the addAttester()
).
Step 3:
User attempts to createAccount()
but they obtain the revert as REGISTRY.check(module, moduleType, attesters, threshold);
reverts.
Outcome:
Temporary inability to create an account via the RegistryFactory
contract until the owner modifies the attesters to be sorted via addAttester()
and removeAttester()
.
Manual Review
Ensure that the attesters[]
array is sorted whenever it is modified. This can be achieved by implementing sorting logic in the addAttester()
and removeAttester()
or applyinh the solady/LibSort
.
Moreover, applying the sorting logic in the constructor
ensures that the attesters
is sorted upon initialization.
Invalid, similar issue to #151 and duplicates - Addition of attesters are admin only functionalities so if duplicate addresses are added it would consitute admin input/call validation. - ERC-7484 is in draft mode so we should not take it as the final EIP configuration yet. - In the [documentation](https://github.com/bcnmy/nexus/wiki#problems-nexus-solves), it is not noted that Nexus suite will be ERC7484 compliant.
Invalid, similar issue to #151 and duplicates - Addition of attesters are admin only functionalities so if duplicate addresses are added it would consitute admin input/call validation. - ERC-7484 is in draft mode so we should not take it as the final EIP configuration yet. - In the [documentation](https://github.com/bcnmy/nexus/wiki#problems-nexus-solves), it is not noted that Nexus suite will be ERC7484 compliant.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.