Submitted by Tointer, also found by V_B, Tricko, Haipls, Koolex, peakbolt, 0xdeadbeef0x, PwnedNoMore, romand, ro, csanuragjain, HE1M, taek, and orion
contracts/smart-contract-wallet/SmartAccount.sol#L212
Signed transaction can be replayed. First user transaction can always be replayed any amount of times. With non-first transactions attack surface is reduced but never disappears.
Contract checks nonces[batchId] but not batchId itself, so we could reuse other batches nounces. If before transaction we have n batches with the same nonce as transaction batch, then transaction can be replayed n times. Since there are 2^256 batchIds with nonce = 0, first transaction in any batch can be replayed as much times as attacker needs.
Insert this test in testGroup1.ts right after Should set the correct states on proxy test:
Add batchId to the hash calculation of the transaction in encodeTransactionData function.
livingrockrises (Biconomy) confirmed
