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

Broken access control leads to protocol functionality freeze #121

Closed
code423n4 opened this issue Jul 21, 2021 · 1 comment
Closed

Broken access control leads to protocol functionality freeze #121

code423n4 opened this issue Jul 21, 2021 · 1 comment
Assignees
Labels
2 (Med Risk) bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

The contracts use an access control pattern where the contract deployer is included in the onlyDAO modifier which is used for authorized access to critical functions. Such contracts also include a purgeDeployer function which renounces (sets to zero-address) the deployer address and is expected to be called by deployer/DAO when the DAO is stable/final so that deployer no longer has access to critical functions.

However, not all such critical functions can be called by the DAO via proposals. This leads to functionality freeze for parameters/logic controlled by such functions once the deployer is purged because the DAO cannot call them anymore.

Such functions are: BondVault::release(), onlyDAO functions in Router, poolFactory::createPool and synthVault::setParams().

Impact: The protocol parameters set in above functions cannot be changed via the DAO. Zero liquidity pools cannot be created via the DAO.

Proof of Concept

https://github.com/code-423n4/2021-07-spartan/blob/e2555aab44d9760fdd640df9095b7235b70f035e/contracts/BondVault.sol#L141-L143

https://github.com/code-423n4/2021-07-spartan/blob/e2555aab44d9760fdd640df9095b7235b70f035e/contracts/Router.sol#L332-L345

https://github.com/code-423n4/2021-07-spartan/blob/e2555aab44d9760fdd640df9095b7235b70f035e/contracts/poolFactory.sol#L64-L77

https://github.com/code-423n4/2021-07-spartan/blob/e2555aab44d9760fdd640df9095b7235b70f035e/contracts/synthVault.sol#L81-L85

Tools Used

Manual Analysis

Recommended Mitigation Steps

Add DAO functions to allow the above functions to be called via proposals. If these are not intended to be set by DAO and only by deployer before being purged, change the modifier and document appropriately.

@code423n4 code423n4 added 2 (Med Risk) bug Something isn't working labels Jul 21, 2021
code423n4 added a commit that referenced this issue Jul 21, 2021
@SamusElderg
Copy link
Collaborator

Duplicate of #172

@SamusElderg SamusElderg marked this as a duplicate of #172 Jul 23, 2021
@SamusElderg SamusElderg added the duplicate This issue or pull request already exists label Jul 23, 2021
@SamusElderg SamusElderg self-assigned this Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants