The sendToL1 function in the smart contract allows any signer to execute arbitrary functions in the vault contract by passing a message. This poses a security risk as signers can bypass the necessary checks and perform unauthorized actions.
The vulnerability lies in the sendToL1 function where it allows signers to execute arbitrary function. The message passed to the function contains the target contract address, the value to send, and the data to execute. This allows signers to call any function in any contract with msg.sender == address(instanceOfL1BossBridge, and so bypass functions that should only be accessible to this contract. But also craft a withdraw message the money of the vault.
Foundry (put in test file) PoC :
This vulnerability allows signers to bypass the necessary checks and execute unauthorized actions in the vault contract. For example, an attacker can use this vulnerability to call the approveTo function in the vault contract, bypassing the owner check and permit (by phishing, threatening, etc) stealing all the vault's funds.
Moreover, the signer can use the same message crafted in the withdrawToL1 to steal all the token.
This vulnerability is explicated in my other submission.
Manual review
To mitigate this vulnerability, it is recommended to implement proper access control mechanisms in the sendToL1 function. The function should only allow signers to execute specific functions that are deemed safe and necessary for the intended functionality of the smart contract (here: withdraw). Additionally, it is important to thoroughly review the permissions and roles assigned to signers to ensure that only authorized actions can be performed.
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.