withdrawTokensToL1 function lacks of standard EIP 712 implementation and uses generic implementation for signatures, which can used by attackers on different chains to drain vaults funds.
In withdrawTokensL1 function, only (address to, uint256 amount, uint8 v, bytes32 r, bytes32 s ) values are given as input. Which forward this given input to function sendToL1 which take v, r and s values as is and encode other variables as message. This approach is generic. Lack of nonce, chainId and deadline make this vulnerable to replay attacks.
Attacker can get a valid signature and use it multiple times. As there is no differentiate like nonce or chain id, so it will be treated as valid signature by the protocol and which will lead to loss of funds.
##POC
In existing test suite file L1TokenBridge.t.sol we create user2 address and transfer 1000e18 tokens like how it's been sent to user
Here is the testForCheckingReplayAttacks
run forge --match-test testForCheckingReplayAttacks -vv in terminal to check all logs.
Users Funds will be lost.
Manual Review
Use Standard EIP-712 approach for signatures to make it robust and free from replay attacks.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.