Submitted by WatchPug
Any transactions that fail based on some conditions that may change in the future are not safe to be executed again later (e.g. transactions that are based on others actions, or time-dependent etc).
In the current implementation, once the low-level call is failed, the whole tx will be reverted and so that _nonces[metaAction.from] will remain unchanged.
As a result, the same tx can be replayed by anyone, using the same signature.
EIP712MetaTransaction.sol#L86
See also the implementation of OpenZeppelins MinimalForwarder:
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.5.0/contracts/metatx/MinimalForwarder.sol#L42-L66
Given:
Alices 10,000 USDC is now been spent unexpectedly against her will and can potentially cause fund loss depends on the market situation.
Failed txs should still increase the nonce.
While implementating the change above, consider adding one more check to require sufficient gas to be paid, to prevent insufficient gas griefing attack as described in this article.
0xca11 (Rolla) confirmed, resolved, and commented:
