Description: The selectPresident
function can be called by any external account, which means any user can trigger the election process to select a new president. This lack of access control could lead to unauthorized or premature elections.
Impact:
Unauthorized Elections: Without proper access control, any user can trigger the election process, potentially disrupting the intended election schedule or process.
Premature Elections: Users could call selectPresident before the community is ready, leading to unexpected changes in leadership.
Proof of Concept: Any user can call the function without restriction:
Recommended Mitigation:
Access Control: Implement access control to restrict who can call the selectPresident function. This could be limited to a specific role or set of addresses (e.g., an admin or governance contract).
Time-Based Restrictions: Ensure that the function can only be called after a certain period or under specific conditions to prevent premature elections.
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.