The NFTXMarketPlaceZap contract allows the user to provide an arbitrary path array that is used to swap, see for example buyAndSwap721WETH.
This path may not be fully arbitrary though, the initial token (path[0]) should be WETH and the terminal token (path[path.length - 1]) should be the vault token.
Recommended Mitigation Steps
Consider verifying the path ends to fail early (instead of at some point when trying to mint/swap at the vault) and provide better error messages.
Handle
cmichel
Vulnerability details
The
NFTXMarketPlaceZap
contract allows the user to provide an arbitrarypath
array that is used to swap, see for examplebuyAndSwap721WETH
. This path may not be fully arbitrary though, the initial token (path[0]
) should be WETH and the terminal token (path[path.length - 1]
) should be the vault token.Recommended Mitigation Steps
Consider verifying the path ends to fail early (instead of at some point when trying to mint/swap at the vault) and provide better error messages.