manager.allowedVaults check missing for add/remove strategy
The addStrategy and removeStrategy functions in the Controller contract lack the manager.allowedVaults check that is present in reorderStrategies. This allows a strategist to add or remove strategies on vaults that are not authorised, potentially causing harm.
Submitted by 0xRajeev
Impact
The manager.allowedVaults check is missing for add/remove strategy like how it is used in reorderStrategies(). This will allow a strategist to accidentally/maliciously add/remove strategies on unauthorized vaults.
Given the critical access control that is missing on vaults here, this is classified as medium severity.
Proof of Concept
Tools Used
Manual Analysis
Recommended Mitigation Steps
Add manager.allowedVaults check in addStrategy() and removeStrategy()
GainsGoblin (yAxis) acknowledged
Implemented in https://github.com/code-423n4/2021-09-yaxis/pull/36
GalloDaSballo (judge) commented:
Sponsor has acknowledged and mitigated by adding further access control checks
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A strategist could accidentally or maliciously add or remove strategies on unauthorised vaults, which may disrupt vault operations or lead to loss of funds.
What the attacker needed
Strategist role
The fix
The fix was to add the manager.allowedVaults check in addStrategy() and removeStrategy(), as implemented in a pull request.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract has different roles, like a manager and a strategist. The manager decides which vaults (storage places for funds) are allowed. The strategist can add or remove strategies (ways to invest funds) but should only do so on allowed vaults. Because a check was missing, the strategist could accidentally or on purpose change strategies on vaults that the manager did not approve.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.