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

Using of balanceOf() function in depositTokensToL2() can put the contract under the risk of DOS

Summary

In L1BossBridge.sol: depositTokensToL2() there is a check as follows:

if (token.balanceOf(address(vault)) + amount > DEPOSIT_LIMIT)

which can be manipulated by transferring a large amount of token to the vault to make it always revert.

Vulnerability Details

As stated above using balanceOf(address(vault)) can be very dangerous as the attacker can make the deposit always revert and corrupt the whole protocol functionality,
Adding to this the fact that there is no restrictions on minting new BBT tokens (this is another finding I've submitted) the exploit of this vulnerability becomes feasible.

Impact

This will disables the functionality of the protocol.

Tools Used

manual review

Recommendations

just check that the deposit is not greater than DEPOSIT_LIMIT

- if (token.balanceOf(address(vault)) + amount > DEPOSIT_LIMIT) {
revert L1BossBridge__DepositLimitReached();
}
+ if ( amount > DEPOSIT_LIMIT) {
revert L1BossBridge__DepositLimitReached();
}
Updates

Lead Judging Commences

0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

depositTokensToL2(): DoS deposits via DEPOSIT_LIMIT

Support

FAQs

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