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

Possible manipulation by malicious users #8

Open
shuo-young opened this issue Feb 23, 2024 · 1 comment
Open

Possible manipulation by malicious users #8

shuo-young opened this issue Feb 23, 2024 · 1 comment

Comments

@shuo-young
Copy link

Dear saucepoint:
I find that a potential risk can arise from the possible parameter manipulation of the function afterSwap(). Malicious attackers can input any value of parameters key and params to manipulate intermediate variables and the key stop loss operation in the internal function fillStopLoss() can also be influenced.

I think critical hooks should all be protected which can only be invoked by pool manager. For example, the afterInitialize() is protected in your StopLoss contract. However, the afterSwap() isn't. So adding a simple protective modifier may be good to avoid potential risk.

Hope it helps and glad to discuss further.

@saucepoint
Copy link
Owner

yep has been flagged before -- just havent had the time to update it. thanks for keeping an eye out!

will leave this open until its fixed 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants