In `validateUserOp()` if the signature is valid there is no deadline check whenever the Users do not make use of the `MagicSpender.sol` as their paymaster allowing their TX vulnerable to MEV Attacks.
Audit: 2024-03-coinbase-findings
Severity: MEDIUM

# Lines of code

https://github.com/code-423n4/2024-03-coinbase/blob/e0573369b865d47fed778de00a7b6df65ab1744e/src/SmartWallet/CoinbaseSmartWallet.sol#L161


# Vulnerability details

## Impact
When the Entry Point validates the user Ops, it checks the `validationData` against an invalid signature and a deadline, this validation is performed on the call to `validateUserOp()` in the SCW Account which returns `0` or `1`:
https://github.com/code-423n4/2024-03-coinbase/blob/e0573369b865d47fed778de00a7b6df65ab1744e/src/SmartWallet/CoinbaseSmartWallet.sol#L137C2-L168C6
```solidity
    function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds)
        public
        payable
        virtual
        onlyEntryPoint
        payPrefund(missingAccountFunds) //@audit state changes are not allowed during validation.
        returns (uint256 validationData)
..SNIP..
        }

        // Return 0 if the recovered address matches the owner.
        if (_validateSignature(userOpHash, userOp.signature)) {
            return 0; //@audit no check on the nonce
        }
..SNIP..
        // Else return 1, which is equivalent to: 
        // `(uint256(validAfter) << (160 + 48)) | (uint256(validUntil) << 160) | (success ? 0 : 1)`
        // where `validUntil` is 0 (indefinite) and `validAfter` is 0.
        return 1;
    }
```
The Entry Point does the necessary checks in `_validateAccountAndPaymasterValidationData()`:

```solidity
    /**
     * revert if either account validationData or paymaster validationData is expired
     */
    function _validateAccountAndPaymasterValidationData(uint256 opIndex, uint256 validationData, uint256 paymasterValidationData, address expectedAggregator) internal view {
        (address aggregator, bool outOfTimeRange) = _getValidationData(validationData);
        if (expectedAggregator != aggregator) {
            revert FailedOp(opIndex, "AA24 signature error");
        }
        if (outOfTimeRange) {
            revert FailedOp(opIndex, "AA22 expired or not due");
        }
..SNIP..
    }
```
which calls `_getValidationData()`:

```solidity
    function _getValidationData(uint256 validationData) internal view returns (address aggregator, bool outOfTimeRange) {
        if (validationData == 0) {
            return (address(0), false);
        }
..SNIP..
    }
```

The build-up to the issue is that when the `validationData == 0` it affirms that the validation was correct and goes ahead to execute the user operation.

The Issue lies in the `validateUSerOp()` line 159 - 162 where it checks the `signature` and if the signature is valid it returns zero which means the signature is valid and the signature deadline isn't `outOfTimeRange` :
https://github.com/code-423n4/2024-03-coinbase/blob/e0573369b865d47fed778de00a7b6df65ab1744e/src/SmartWallet/CoinbaseSmartWallet.sol#L159C1-L162C10
```solidity
      if (_validateSignature(userOpHash, userOp.signature)) {
            return 0; //@audit returns zero w