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

L1BossBridge.sol - withdrawTokensToL1 - Missing `whenNotPaused` modifier for withdrawTokensL1 nethods in L1BossBridge

Summary

To ensure user safety, this first version of the bridge has a few security mechanisms in place:
The owner of the bridge can pause operations in emergency situations.

Base on the documentation critical function should be protected by whenNotPaused

Vulnerability Details

Missing modifier

function withdrawTokensToL1(address to, uint256 amount, uint8 v, bytes32 r, bytes32 s)
external
// -> Missing whenNotPaused modifier
{
sendToL1(
v,
r,
s,
abi.encode(
address(token),
0, // value
abi.encodeCall(IERC20.transferFrom, (address(vault), to, amount))
)
);
}

Impact

When the contract is paused withdrawTokensToL1 won't revert right away, costing more gas to the user.

Tools Used

Manual

Recommendations

Add modifier to withdrawTokensToL1

-function withdrawTokensToL1(address to, uint256 amount, uint8 v, bytes32 r, bytes32 s) external {
+function withdrawTokensToL1(address to, uint256 amount, uint8 v, bytes32 r, bytes32 s) external whenNotPaused {
sendToL1(
v,
r,
s,
abi.encode(
address(token),
0, // value
abi.encodeCall(IERC20.transferFrom, (address(vault), to, amount)) // @note use safe call instead
)
);
}
Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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