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

MatricksDeCoder - Lack of input validations #97

Closed
sherlock-admin opened this issue Jan 25, 2024 · 0 comments
Closed

MatricksDeCoder - Lack of input validations #97

sherlock-admin opened this issue Jan 25, 2024 · 0 comments
Labels
Non-Reward This issue will not receive a payout

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jan 25, 2024

MatricksDeCoder

medium

Lack of input validations

Summary

Critical parameters like addresses and sanity checks of values lack input validation e.g constructor in GovernanceBravoDelegator lacks input validation on all passed-in parameters,

Vulnerability Detail

Take for example the constructor in GovernanceBravoDelegator .sol parameters are not validated as suggested in Compound audit Medium finding, and olympus uses compound governance

Impact

Not checking values allows setting of address to address(0), e.g timelock, ohm address, kernel implementation can be set to address(0).

uint256 votingPeriod_, uint256 votingDelay_, uint256 proposalThreshold_ can be set to arbitrary values that makes the voting module not work or not work as expected. These need to be sanity checked and bounded

Code Snippet

2024-01-olympus-on-chain-governance-MatricksDeCoder/bophades/src/external/governance/GovernorBravoDelegator.sol

constructor(
        address timelock_,
        address gohm_,
        address kernel_,
        address implementation_,
        uint256 votingPeriod_,
        uint256 votingDelay_,
        uint256 proposalThreshold_
    ) {
        // Admin set to msg.sender for initialization
        admin = msg.sender;

        delegateTo(
            implementation_,
            abi.encodeWithSignature(
                "initialize(address,address,address,uint256,uint256,uint256)",
                timelock_,
                gohm_,
                kernel_,
                votingPeriod_,
                votingDelay_,
                proposalThreshold_
            )
        );

Tool used

Manual Analysis
OpenZeppelin Audit of Compund https://blog.openzeppelin.com/compound-governor-bravo-audit

Recommendation

Consider bounding inputs to reasonable ranges and excluding certain values, such as address(0) or uint256(0) from being successfully passed in. This will reduce the surface for error when using these functions.

Duplicate of #21

@github-actions github-actions bot added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jan 27, 2024
@sherlock-admin sherlock-admin changed the title Curly Pine Loris - Lack of input validations MatricksDeCoder - Lack of input validations Jan 30, 2024
@sherlock-admin sherlock-admin added Non-Reward This issue will not receive a payout and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non-Reward This issue will not receive a payout
Projects
None yet
Development

No branches or pull requests

1 participant