code-423n4 / 2021-10-slingshot-findings

0 stars 0 forks source link

BalancerV2ModuleMatic: Ensure tokenOut is not native token #38

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

hickuphh3

Vulnerability details

Impact

The executioner is designed to handle only ERC20-ERC20 token trades by modules. The balancer V2 vault is able to automatically unwrap the wrapped native token. Hence, it is recommended to ensure that the tokenOut parameter passed into the swap() function is not the sentinel value.

The sentinel value used is the null address.

Recommended Mitigation Steps

Consider adding the following check in the function.

require(tokenOut != address(0), 'native token swap not supported');