-
Notifications
You must be signed in to change notification settings - Fork 2
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
ready() is not Enough to Assume The Vault is Safe #77
Comments
All vaults in a pool should be ready before the pool is ready. |
Just like you said:
But the "ready()" function does not check this. It checks just the current vault and reports its boolean result. Hence what you are saying and what the code is doing are in complete contradiction. If we want to approach it with common sense, what we can expect from our common sense can only be: relying on "ready()" functions return value before using vault. But although this is what common sense tell us, it is not the case. Even if "ready()" function in a vault returns "true", pool can be unsafe to use because of the reasons provided in the issue. I want to propose the following solution for this: 1- Create a storage variable (boolean) indicating all connected vaults are ready. You can name it "finalized" for example. Regarding 4th point above: Best regards. |
We have decided to classify this issue as won’t fix. Our decision is based on the following arguments:
According to these arguments, the issue has been classified as won't fix. |
Github username: --
Twitter username: --
Submission hash (on-chain): 0xb400710df222077848b27e5e57f5b13cd189bd8c4debe32dd8e4d54c38515881
Severity: high
Description:
Description
"setupMaster" can call 2 functions: "setConnection()" and "finishSetup()". setConnection() connect vaults to create pools. finishSetup() take away setupMaster role hence no new vaults can be connected to pools. As we can see from ready() function, in order for vault to be assumed safe, setupMaster should call finishSetup():
Why this is so important? Because setupMaster can drain the pool as mentioned by NatSpec. It can create malicious vaults with malicious tokens and connect them to benign vault and steal the funds from users if users use the vault before finishSetup() called.
What I will argue next is that this is not enough.
Attack Scenario
Now let's examine if vault is really ready:
Scenario 1:
Scenario 2:
How to prevent:
ready() function should not return just given vault's setupMaster check. It should also check if connected vaults' setupMaster also called finishSetup() or not.
The text was updated successfully, but these errors were encountered: