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

Anubis - GovernorBravoDelegateStorage - Lack of Proper Access Control and Data Integrity #34

Closed
sherlock-admin2 opened this issue Jan 25, 2024 · 1 comment
Labels
Excluded Excluded by the judge without consulting the protocol or the senior Non-Reward This issue will not receive a payout

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Jan 25, 2024

Anubis

high

GovernorBravoDelegateStorage - Lack of Proper Access Control and Data Integrity

Summary

The GovernorBravoDelegateStorageV2 contract and its related storage contracts lack proper access control mechanisms for critical state variables and functions, potentially allowing unauthorized modification of governance parameters and proposal records.

Vulnerability Detail

Critical state variables such as votingDelay, votingPeriod, proposalThreshold, and mappings like proposals and latestProposalIds are public with no explicit setter functions containing access control mechanisms. This could allow unauthorized actors to modify governance settings or tamper with proposal records.

Impact

An attacker could exploit this vulnerability to disrupt the governance process by altering governance parameters or tampering with proposal records, potentially leading to incorrect governance decisions, loss of funds, or undermining the governance system's integrity.

Code Snippet

https://github.com/sherlock-audit/2024-01-olympus-on-chain-governance/blob/main/bophades/src/external/governance/abstracts/GovernorBravoStorage.sol#L91-L117

Tool used

Manual Review

Recommendation

Implement access control mechanisms such as the onlyAdmin modifier for functions that modify critical state variables or governance parameters. Ensure that state variables that hold sensitive data are either private or have controlled, restricted access.

Code Snippet for Fix:

// Use the onlyAdmin modifier for functions that should be restricted
modifier onlyAdmin {
    require(msg.sender == admin, "GovernorBravoDelegateStorage: Unauthorized");
    _;
}

function setVotingDelay(uint256 _votingDelay) public onlyAdmin {
    votingDelay = _votingDelay;
    emit VotingDelayUpdated(_votingDelay);
}

function setVotingPeriod(uint256 _votingPeriod) public onlyAdmin {
    votingPeriod = _votingPeriod;
    emit VotingPeriodUpdated(_votingPeriod);
}

function setProposalThreshold(uint256 _proposalThreshold) public onlyAdmin {
    proposalThreshold = _proposalThreshold;
    emit ProposalThresholdUpdated(_proposalThreshold);
}

// ...similar setters for other critical state variables with proper access control

By enforcing access control and ensuring the integrity of critical governance data, the contract can prevent unauthorized modifications, maintaining the governance system's integrity and intended behavior.

@github-actions github-actions bot added the Excluded Excluded by the judge without consulting the protocol or the senior label Jan 27, 2024
@nevillehuang
Copy link
Collaborator

Invalid, this are public GETTER functions, not SETTER functions. In GovernorBravoDelegate.sol, there are permissions in place for changing these state variables

@sherlock-admin2 sherlock-admin2 changed the title Helpful Denim Salmon - GovernorBravoDelegateStorage - Lack of Proper Access Control and Data Integrity Anubis - GovernorBravoDelegateStorage - Lack of Proper Access Control and Data Integrity Jan 30, 2024
@sherlock-admin2 sherlock-admin2 added the Non-Reward This issue will not receive a payout label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Excluded Excluded by the judge without consulting the protocol or the senior Non-Reward This issue will not receive a payout
Projects
None yet
Development

No branches or pull requests

2 participants