Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exchangeTokens performs unsafe uniswap trade #35

Open
livnev opened this issue Jun 2, 2020 · 2 comments
Open

exchangeTokens performs unsafe uniswap trade #35

livnev opened this issue Jun 2, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@livnev
Copy link

livnev commented Jun 2, 2020

exchangeTokens, which is called internally from create and exercise, uses the Uniswap V2 router to perform a trade of payment tokens to linked tokens. This trade is done with no validation of the price at which the trade will be executed. As a result, the pool may suffer losses due selling tokens below the market price.

Moreover, this may be exploitable by an attacker who sandwiches their call to create or exercise between two trades on the Uniswap pool which manipulate the price to the detriment of the pool, potentially allowing the attacker to extract either a portion of the option premium or the settlement payment of the option, respectively.

For more information on this class of attacks, please see the section on Swap Composability in the recent audit of Uniswap V2.

@livnev
Copy link
Author

livnev commented Jun 2, 2020

cc @TomAFrench @thomas-waite

@TomAFrench
Copy link
Contributor

Hi @livnev. Thanks for flagging up this issue!

We're planning on having a full review of the Options contract code as we had to focus on other areas to build a demo due to the hackathon deadline. We're aware of several vulnerabilities in the code as a result. We'll make sure to address this vulnerability at the same time.

@thomas-waite thomas-waite added the bug Something isn't working label Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants