Core Contracts

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

Insufficient Salt Uniqueness in Proposal Hashing Leading to Potential Execution Failures After Voting

Summary

The current implementation of the salt in the hashOperationBatch function does not provide sufficient protection against hash collisions. The salt is derived solely from the descriptionHash, which may lead to potential vulnerabilities if two different proposals have the same description.

Vulnerability Details

The vulnerability lies in the _queueProposal function, where the salt is calculated using only the descriptionHash. The descriptionHash is generated from the proposal's description, which may not be unique across different proposals. If two proposals have the same description, they will produce the same descriptionHash, resulting in identical salts. This lack of uniqueness increases the risk of hash collisions.

Code Snippet

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/proposals/TimelockController.sol#L325

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));
}

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/proposals/Governance.sol#L490

In the _queueProposal function, the salt is derived from the descriptionHash:

bytes32 salt = proposal.descriptionHash;

Impact

  • Hash Collisions: Two different proposals could end up with the same.

Since the proposal must pass the voting period before it can be queued and the hash is calculated, the current implementation could lead to problematic scenarios. A user might create a proposal that successfully passes the voting phase, only for it to revert during execution due to a hash collision. This could result in wasted time, resources, and user frustration.

Tools Used

  • Manual code review

Recommendations

To mitigate this vulnerability, it is recommended to enhance the uniqueness of the salt by incorporating additional unique identifiers, such as the proposer's address. This will significantly reduce the risk of hash collisions and improve the overall security of the system.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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 7 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.

Give us feedback!