You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 30, 2025. It is now read-only.
requestERC20() function in L1GatewayRouter would ideally never be called thus leading to DoS
Summary
The onlyInContext check in L1GatewayRouter.sol file checks the _msgSender against the L1GatewayRouter.sol::gatewayInContext variable which is always address(0) by default thus making the function unusable.
Root Cause
Invalid checking of msgSender and L1GatewayRouter::gatewayInContext variables leads to never allowing the sender to enter the function in no context.
if (router == _sender) {
// Extract real sender if this call is from L1GatewayRouter.
(_from, _data) =abi.decode(_data, (address, bytes));
_amount =IL2GatewayRouter(_sender).requestERC20(_from, _token, _amount);
}
in the L2ReverseCustomGateway.sol:_transferERC20In method
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Leading to unsuable bridging of ERC20 tokens from L1 to L2
PoC
No response
Mitigation
Use the onlyNotInContext modifer instead of onlyInContext