This issue involves the utilization of vault address as arbitrary from in the transferFrom function within the depositTokensToL2 function in the file L1BossBridge.sol.
Upon a manual review and employing tools such as 4nalizer and Slither, it was discovered that the depositTokensToL2 function employs an arbitrary from in the transferFrom function. This allows anyone to specify the address of the vault contract, facilitating the withdraw of the funds from the vault contract in the L2. The severity of this issue lies in the fact that if an user initiates a deposit from the vault contract to the same vault address, that user can obtain tokens from the bridge on the L2 network without depositing in the L1.
Here's the relevant code snippet:
And here's a relevant test scenario:
The impact of this issue is deemed high, as it exposes the funds to potential risks. The current implementation allows an attacker to manipulate the from parameter to use the vault address, leading to the unauthorized withdrawal of tokens from the bridge in other network.
Manual Review
4nalizer
Slither
To mitigate this issue, it is strongly recommended to replace the arbitrary from with msg.sender within the depositTokensToL2 function. This adjustment will prevent potential exploits and unauthorized access to the funds, enhancing the security of the contract.
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.