code-423n4 / 2021-12-nftx-findings

0 stars 0 forks source link

Zaps should verify paths #137

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

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.

0xKiwi commented 2 years ago

We sometimes use different paths based on the token. Acknowledging.