The withdrawTokensToL1 function in the smart contract allows any signer to withdraw tokens from the vault to a specified address. This can lead to unauthorized withdrawal of tokens by malicious signers.
The vulnerability lies in the withdrawTokensToL1 where the abi.encodeCall is used to construct a call to the transferFrom function of the token contract. However, the transferFrom call is made with the vault as the from address, and an arbitraryto address specified by the signer. This allows any signer to transfer tokens to an address of their choice, potentially stealing the user's tokens.
Foundry (put in test file) PoC :
Loss of all funds : Any signers who sign a withdrawal to their accounts can steal all the money
Manual review
To fix this vulnerability, the withdrawTokensToL1 function should be modified to define, thanks to blockchain automation (and oracles), the to parameter without the need of a signer or any other user. This will ensure that tokens are transferred from the vault to the user who ask for a withdraw, preventing unauthorized withdrawals.
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.