The K1Validator
does not include the sender
address when calling the function isValidSignatureWithSender
, which allows signature replay attacks on accounts owned by the same user. This vulnerability can lead to significant financial losses for the affected accounts.
In the ModuleManager
, the function _enableMode
is used to verify and enable a validator before the validation of PackedUserOp
, as shown below:
The digest of the signature does not include the address of the account on which the module will be enabled. Then, the function _checkEnableModeSignature
is called to verify the signature:
The function isValidSignatureWithSender
is called, and the address of the account (address(this)
) is passed as the sender address to be verified with the enableModeSignature
. However, if the validator is the K1Validator
, the implementation of the function isValidSignatureWithSender
is as follows:
This function neglects the sender address and verifies the enableModeSignature
using SignatureCheckerLib
without considering the sender
address. The function retrieves the owner of the account making the call and verifies that the owner signed the message.
As a result, if the owner owns multiple accounts (e.g., three accounts), the enableModeSignature
used to enable any module on one account will be valid for the other accounts as well.
Suppose the owner has three accounts: account A, account B, and account C. The owner signs a userOp to enable validator G on account A. The structure of the userOp does not include the address of account A since it is not used in the validation process. Consequently, this userOp
and the enableModeSignature
will also be valid on the other accounts, allowing unintended validators to be installed on those accounts.
A malicious user can exploit this vulnerability to perform replay attacks across multiple accounts owned by the same user. This can result in the unintended installation of validators and the potential loss of funds from the affected accounts.
vscode
Include Sender Address in Signature Verification: Modify the isValidSignatureWithSender
function to include the Nexus account address in the signature verification process to prevent replay attacks across multiple accounts.
Implementing these measures will safeguard against signature replay attacks and secure the funds within the accounts.
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.