DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

caller is authorized to propose proposals

One potential security vulnerability in the DittoGovernor contract is that the propose() function does not check whether the caller is authorized to propose proposals. This means that any attacker can call the propose() function to propose a malicious proposal, even if they do not own any Ditto tokens.

To reproduce this vulnerability, an attacker would simply need to call the propose() function with malicious targets, values, and calldatas. For example, the attacker could propose a proposal to transfer all of the Ditto tokens in the governor contract to their own wallet.

To mitigate this vulnerability, the propose() function should be updated to check whether the caller is authorized to propose proposals. This can be done by adding a require() statement to the beginning of the function to check whether the caller is a member of a specific role, such as the proposer role.

Here is an example of how to mitigate this vulnerability:

function propose(
address[] memory targets,
uint256[] memory values,
bytes[] memory calldatas,
string memory description
)
public
override(Governor, GovernorCompatibilityBravo, IGovernor)
returns (uint256)
{
require(hasRole(PROPOSER_ROLE, msg.sender), "Only proposers can propose proposals");

return super.propose(targets, values, calldatas, description);

}
This will ensure that only authorized users can propose proposals, which will help to protect the DittoGovernor contract from malicious attacks.

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.