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

Privileged addresses can be transferred without confirmation even to invalid values #198

Closed
ggrieco-tob opened this issue Jan 17, 2020 · 1 comment

Comments

@ggrieco-tob
Copy link

Severity: Low
Difficulty: Medium

Description

An incorrect use of the functions to set privileged addresses in contracts can irreversibly set them to invalid addresses, such as 0x0.

The owner or the controller of the contracts can change the address of privileged addressed using functions such as setController and setBLabs:

https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol#L205-L212
https://github.com/balancer-labs/balancer-core/blob/master/contracts/BFactory.sol#L51-L54

However, these functions do not check for invalid values (e.g. 0x0) and they work in a single transaction.

Exploit Scenario

Alice creates a pool. She uses some off-chain code to manage it . However, a software issue in her code calls the setController function with an uninitialized value (0x0). The BPool code accepts this new value and the locks up Alice's pool. As a result of that, she will need to create a new pool.

Recommendation

Short term, split this important functionality in several functions. For instance, to change the current controller, implement setController and acceptController which reject any null address. Additionally, add a renounceController function that allows to set the controller to 0x0 if needed.

Long term, use Echidna and Manticore to verify that the administrative addresses cannot be set to incorrect values.

@mikemcdonald
Copy link
Member

Won't fix. setBLabs won't be used in bronze since the EXIT_FEE is 0. And the additional UX complexity does not outweigh the benefits of splitting setController

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

No branches or pull requests

2 participants