Modules may not be properly checked if user re-configures registry for the account, due to that the attesters in the registry are not reset.
User can call setRegistry() through EntryPoint to configure registry for account.
The trustAttesters() on the registry will be called, as confirmed by sponsor, the implementation code of the registry contract (TrustManager) they are planning to use can be find here, and the `trustAttesters()` is as below:
Assuming that user configure the registry for the first time, attesters are [attesterA, attesterB], threshold is 2, we can have $trustedAttester.linkedAttesters be like:
attesterA -> attesterB
When user re-configure the registry, they set attesters to [attesterA] and threshold to be 1, then in the code attestersLength is 1 and is later decreased to be 0, the for loop won't be enterred:
The $trustedAttester.linkedAttesters remains unchanged and we have:
$trustedAttester.attesterCount: 1
$trustedAttester.threshold: 1
$trustedAttester.attester: attesterA
$trustedAttester.linkedAttesters: attesterA -> attesterB
This is problematic and can lead to that the modules are not properly checked. Let's have a look at the _check() function which is eventually called by Nexus Account:
In our case, if the result of the attestation from attesterA is false, it will still go into the for loop, get attestation from attesterB and check the module's validity by using the attestation, this is definitely not expected despite the result.
The culprit is that the attesters for the account in the registry are not reset before re-configuring, but it's not TrustManager to blame because it's an abstract contract and its functionalities can be incomplete, also because neither trustAttesters() nor _check() is virtual hence cannot to be overridden, we can reasonably assume that its child contract in-prod provides extra functionality, e.g. function to remove linked attesters for the Nexus accounts, and this functionality needs to be called from Nexus account.
Modules may not be properly checked by the registry.
Manual Reivew
Suppose the `removeLinkedAttesters()` function is provided by the registry to remove attesters for the account, we need to call it from Nexus contract to fix the issue:
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.