sherlock-audit / 2022-10-mover-judging

1 stars 0 forks source link

__141345__ - Signature replay #63

Closed sherlock-admin closed 2 years ago

sherlock-admin commented 2 years ago

141345

high

Signature replay

Summary

The CardTopupMPTProof() function verifies the signatures for authorization. However, signature without nonce is susceptible to replay vulnerability.

Vulnerability Detail

The SignedTransaction does not contain nonce, so the same signature could be reused. If the user mistakenly submitted the transaction multiple times, or due to network problem or congestions, the fund could be transferred unexpected.

Impact

Users funds could be transferred multiple times by the same signature submission, but not expected by the user.

Code Snippet

https://github.com/sherlock-audit/2022-10-mover/blob/main/cardtopup_contract/contracts/HardenedTopupProxy.sol#L507-L515

https://github.com/sherlock-audit/2022-10-mover/blob/main/cardtopup_contract/contracts/HardenedTopupProxy.sol#L1064

Tool used

Manual Review

Recommendation

Add nonce in the SignedTransaction struct.

Duplicate of #42