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
improve: L05 Low Level Call to External Exchange Contract With Arbitrary Calldata (#439)
The SwapAndBridge contract enables swapping an amount of tokens via a
decentralized exchange service of preference and then bridge the swapped
amount via Across. Both swap and bridging actions take place within a
single transaction. To execute the swap, the SwapAndBridge contract
performs a low level call to the designated exchange contract. For this
call, the calldata parameters are arbitrarily given by the user. The
only restriction is that the called function selector must be different
than an ERC-20 token's transferFrom function.
Performing a low level call with arbitrary data to an external contract
should be avoided as it increases the possible attack surface.
Instead of blacklisting the suspicious calldata parameters, consider
whitelisting the allowed ones. More specifically, consider whitelisting
the specific swap function selectors of the external exchange in each
SwapAndBridge contract.
This fix originally authored by Nick.
Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
0 commit comments