code-423n4 / 2023-10-opendollar-findings

10 stars 7 forks source link

The protocol uses a vulnerable `GovernorCompatibilityBravo` version #379

Closed c4-submissions closed 1 year ago

c4-submissions commented 1 year ago

Lines of code

https://github.com/open-dollar/od-contracts/blob/f4f0246bb26277249c1d5afe6201d4d9096e52e6/src/contracts/gov/ODGovernor.sol#L12

Vulnerability details

Impact

Proof of Concept

ODGovernor contract

import {GovernorCompatibilityBravo} from '@openzeppelin/governance/compatibility/GovernorCompatibilityBravo.sol';

GovernorCompatibilityBravo.propose function that is currently inherited from the vulnerable GovernorCompatibilityBravo contract

  function propose(
        address[] memory targets,
        uint256[] memory values,
        bytes[] memory calldatas,
        string memory description
    ) public virtual override(IGovernor, Governor) returns (uint256) {
        _storeProposal(_msgSender(), targets, values, new string[](calldatas.length), calldatas, description);
        return super.propose(targets, values, calldatas, description);
    }

Tools Used

Manual Testing.

Recommended Mitigation Steps

Update the OpenZeppelin version of contracts to a version >=4.8.3

Assessed type

Library

c4-pre-sort commented 1 year ago

raymondfam marked the issue as low quality report

c4-pre-sort commented 1 year ago

raymondfam marked the issue as duplicate of #17

c4-judge commented 1 year ago

MiloTruck marked the issue as unsatisfactory: Out of scope