Open sherlock-admin4 opened 2 months ago
The protocol team fixed this issue in the following PRs/commits: https://github.com/equilibria-xyz/perennial-v2/pull/444 https://github.com/equilibria-xyz/root/pull/104
Note that in addition to the above PR, there is a 1-line update to the root
package to enable this fix: https://github.com/equilibria-xyz/root/pull/104
eeyore
Medium
Anyone can cancel other accounts
nonces
andgroups
, leading to griefing theirIntents
.Summary
Within the
AccountVerifier
,OrderVerifier
, andVerifier
, anyone can call theverifyCommon()
orcancelGroupWithSignature()
functions with properly crafted data and signatures to cancel other usersnonces
orgroups
. This occurs because the signature is only compared to ensure thesigner
is the address fromcommon.signer
, but the cancellation is performed forcommon.account
. There is no additional validation to confirm thatcommon.signer
is an allowed signer for thecommon.account
.Vulnerability Detail
As seen in the
VerifierBase
, the only check performed is signature validation againstcommon.signer
:In the
validateAndCancel()
modifier, the nonce is prechecked and later canceled forcommon.account
without verifying thatcommon.signer
is an allowed signer forcommon.account
:As the same validation flow is used in
cancelGroupWithSignature()
, any group can be canceled as well.This can lead to situations where:
Intent
can be canceled by anyone, rendering theIntents
useless.Intents
system.The
VerifierBase
is used in all verifier contracts, affecting all functions that rely onIntents
.Impact
Intents
functionality broken.Code Snippet
https://github.com/sherlock-audit/2024-08-perennial-v2-update-3/blob/main/root/contracts/verifier/VerifierBase.sol#L18-L24
https://github.com/sherlock-audit/2024-08-perennial-v2-update-3/blob/main/root/contracts/verifier/VerifierBase.sol#L54-L57
https://github.com/sherlock-audit/2024-08-perennial-v2-update-3/blob/main/root/contracts/verifier/VerifierBase.sol#L76-L86
Tool used
Manual Review
Recommendation
Add additional validation to ensure that
common.signer
is an allowed signer forcommon.account
.