The K1Validator
is responsible for validating userOps
by invoking the validateUserOp
function. However, the validator does not verify the nonce of the accounts, making it vulnerable to signature replay attacks. An attacker can reuse the same PackedUserOperation
multiple times, resulting in the draining of all funds from the affected account.
In the K1Validator
, the validateUserOp
function is intended to ensure that the owner of the account is the signer of the userOp
. This function employs SignatureCheckerLib
to verify the signer. However, it comes with a critical warning:
The validateUserOp
function must verify that the nonce in the userOp
matches the current nonce of the account. Subsequently, the nonce should be updated to prevent replay attacks. Failure to perform this verification allows attackers to submit a signed userOp
repeatedly, thus exploiting the vulnerability.
as shown here :
the function validateUserOp
, only checks that the message got signed by the owner , and does not validate the nonce
A malicious user can exploit this vulnerability by submitting a signed userOp
that transfers tokens to their account. By repeating this process, they can drain all the funds from the compromised account.
vscode , manual review
Nonce Verification: Ensure that the validateUserOp
function checks the nonce in the userOp
against the current nonce of the account.
Nonce Update: After a successful validation, update the nonce to prevent reuse.
consider add a mapping called accountToNonce
which stores the nonce of each account that has installed the K1Validator
Implementing these measures will safeguard against signature replay attacks and secure the funds within the accounts.
Invalid, `validateUserOp` can only be called via the `EntryPoint` contract, wherein the [nonce is appropriately updated and checked](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/core/EntryPoint.sol#L650-L652)
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.