Once a signature is issued, the signer has no means to manually invalidate it, other than executing a transaction associated with a signature (which will increment the nonce through the _useNonce
function). This can lead to issues in cases where the signature holder is compromised, the signer has made a mistake, or they simply wish to invalidate an existing signature, as there are no means available for the signer to revoke the signature.
The permit
signatures in ZkTokenV1.sol and ZkTokenV2.sol offers the signer the option to create a EIP-712 signature which can be used for vote delegation. This handles the signature nonce through the _useNonce
function
The same can be observed in L2WrappedBaseToken which offers a permit functionality, which also relies on openzeppelin's ERC20PermitUpgradeable.sol and subsequently, the _useNonce
The contracts however offer no method that allows the owner to invalidate its nonce since the _useNonce
function is internal and cannot be directly accessed.
Similar finding from Cyfrin team.
As a result, signatures cannot be cancelled before their expiry, even if its needed to be.
Manual Review.
Introduce an external function like IncreaseNonce
that will query _useNonce
on behalf of msg.sender
. A similar mechanism can be found in ZkMerkleDistributor.sol - https://github.com/Cyfrin/2024-10-zksync/blob/cfc1251de29379a9548eeff1eea3c78267288356/zk-governance/l2-contracts/src/ZkMerkleDistributor.sol#L277
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.