Missing access control in non-batched InflationManager execute funtions #56
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-05-backd/blob/main/protocol/contracts/tokenomics/InflationManager.sol#L145-L155
https://github.com/code-423n4/2022-05-backd/blob/main/protocol/contracts/tokenomics/InflationManager.sol#L236-L249
https://github.com/code-423n4/2022-05-backd/blob/main/protocol/contracts/tokenomics/InflationManager.sol#L321-L330
Vulnerability details
Impact
Several actions need to be prepared and go through a time-lock before they can be executed.
InflationManager
allows anyone to call the single action execute function but requiresonlyRoles2(Roles.GOVERNANCE, Roles.INFLATION_MANAGER)
for the batched versions. This looks like an oversight since the same access control level should be enforced.For example, the
executeLpPoolWeight
function allows anyone to call it:https://github.com/code-423n4/2022-05-backd/blob/main/protocol/contracts/tokenomics/InflationManager.sol#L241-L249
But the batched version enforces the caller to have
GOVERNANCE
orINFLATION_MANAGER
roles:https://github.com/code-423n4/2022-05-backd/blob/main/protocol/contracts/tokenomics/InflationManager.sol#L284-L301
The same happens in
executeAmmTokenWeight
versusbatchExecuteAmmTokenWeights
, as well asexecuteKeeperPoolWeight
versusbatchExecuteKeeperPoolWeights
.If only trusted roles should be able to execute pending actions then the
onlyRoles
modifier should be added to the non-batched functions.Scenarios where you would not want to allow anyone to execute could include potential votes/changes that may trigger a bug or undesired behavior noticed after it had already been approved.
Tools Used
vim
Recommended Mitigation Steps
Enforce the proper access control mechanism in non-batched execute functions.
The text was updated successfully, but these errors were encountered: