Nexus
contract's executeFromExecutor()
function cannot be used because withRegistry
checks wrong address: msg.sender
Before going forward, I would like to add the reference for this finding. This issue was recently discorvered in the Safe7579's AckeeBlockchain audit. The issue report can be found here: H2: Executors cannot be used
The function Nexus.executeFromExecutor
allows ERC-7579
executor modules to execute operations on behalf of Nexus smart accounts:
The withRegistry
modifier should check that the sender module is attested as an executor module by trusted attesters with a given threshold. However, the execution always fails because the check is performed for the address of the smart account (the address of Proxy) and not the address of the executor module.
Smart account owners install a new executor module for automated token transfers. The executor module calls the executeFromExecutor
function on the smartc account. The execution drops to the fallback handler, which calls Nexus.executeFromExecutor
from the smart account as an external call. Given this execution, msg.sender
used in the withRegistry modifier is the address of the smart account, while the executor module address is encoded at the end of the call data.
Replace msg.sender with _msgSender()
in the withRegistry modifier
to check the executor module address and allow executor modules to be used, just like the safe7579 mitigation
Invalid, I believe there is no issue here, the caller is the executor module, so there will be no reverts. Otherwise, please provide a PoC to prove a revert.
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.