Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

Identical proposal parameters cause operation ID collision

Summary

In contracts::core::governance::proposals::Governance.sol, the _queueProposal function computes an operation ID using a hash of the proposal's targets, values, calldata, and description hash. If two proposals have the same targets, values, calldata, and description hash, they will generate identical operation IDs, causing a collision. This prevents the second proposal from being properly queued and executed, leading to governance deadlocks.

Vulnerability Details

The issue arises in _queueProposal, where the operation ID is calculated using the proposal's targets, values, calldatas and description hash.

In contracts::core::governance::proposals::Governance.sol#L487-L497:

function _queueProposal(uint256 proposalId) internal {
ProposalCore storage proposal = _proposals[proposalId];
bytes32 salt = proposal.descriptionHash;
bytes32 id = _timelock.hashOperationBatch(
proposal.targets,
proposal.values,
proposal.calldatas,
bytes32(0),
salt
);

Those parameters will be used in hashOperationBatch to generate a unique operation ID.

In contracts::core::governance::proposals::TimelockController.sol#L318-L326:

function hashOperationBatch(
address[] calldata targets,
uint256[] calldata values,
bytes[] calldata calldatas,
bytes32 predecessor,
bytes32 salt
) public pure returns (bytes32) {
return keccak256(abi.encode(targets, values, calldatas, predecessor, salt));
}

This means two proposals with identical targets, values, calldatas, and descriptionHash will result in the same id. The _operations mapping in TimelockController contract stores the operation information including its timestamp and executed status. As a result, when a second identical proposal is proposed, the operation information will be incorrect since an entry with the same ID already exists, preventing it from being properly queued and executed.

Impact

Having the same operation ID can cause a number of problems. Some of them are:

  • Governance Deadlock: If a proposal is queued, subsequent identical proposals cannot be queued, limiting governance flexibility.

  • Proposal Reusability Issue: Some proposals may need to be reintroduced with the same parameters, but the system will block them due to the collision.

Tools Used

Manual Review

Recommendations

Include a proposal-specific nonce in the hash calculation to ensure uniqueness. Alternatively, consider incorporating the unique proposalId instead of descriptionHash.

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Governance generates non-unique timelock operation IDs for different proposals with identical parameters, allowing timelock bypass and proposal DoS attacks

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Governance generates non-unique timelock operation IDs for different proposals with identical parameters, allowing timelock bypass and proposal DoS attacks

Support

FAQs

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