The Governance contract allows for arbitrary function calls to any contract via its Governance::propose function. This includes calling unrelated functions on any contract and executing potentially malicious actions, such as draining funds or performing unauthorized upgrades. The lack of proper validation for proposal types and the unrestricted ability to execute arbitrary functions presents a critical security vulnerability.
The IGovernance::ProposalType enum is defined, but it is not used to restrict the type of actions that can be proposed. As a result, users can propose arbitrary function calls on any contract, regardless of the intended proposal type (e.g., ParameterChange, SmartContractUpgrade, TreasuryAction, etc.).
No access control or validation is implemented to ensure that proposals are only executed by trusted addresses or for valid purposes. This means that an attacker with sufficient voting power could propose and execute actions such as:
Draining funds from the treasury.
Performing smart contract upgrades that give them control over the system.
Changing protocol parameters in a malicious way.
The vulnerability allows an attacker with sufficient governance voting power to:
Execute arbitrary function calls on any contract.
Drain funds from the protocol's treasury or perform malicious actions.
Perform unauthorized smart contract upgrades.
Potentially take full control of the protocol by executing actions that modify key parameters or governance rules.
This can lead to a complete compromise of the protocol, financial loss, and loss of user trust.
PoC
Manual review of contract code and tests.
Strict Validation for Proposal Types:
Implement logic to ensure that each proposal type is associated with specific valid actions:
ParameterChange: Only allow protocol parameter changes.
SmartContractUpgrade: Only allow upgrades to predefined trusted contracts.
TreasuryAction: Require multi-sig or additional checks for fund transfers.
EmissionChange: Restrict changes to emission rates based on specific criteria.
Access Control:
Ensure that proposals and executions are controlled by trusted accounts or entities. For example, implement role-based access control (RBAC) or multi-signature wallets to approve critical actions like smart contract upgrades and treasury transfers.
Proposal Execution Validation:
Before executing a proposal, validate that the proposed action is legitimate. For example, verify that contract upgrade proposals point to trusted addresses, and that treasury transfers go to verified accounts.
Auditing and Monitoring:
Implement a mechanism to log and monitor governance proposals and their execution in real-time, to quickly detect and respond to malicious activity.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.