Approved proposals could remain in a Ready state indefinitely, and malicious user can take advantage of this and execute the proposal under different conditions than the one under which the proposal was submitted.
After security Council or Guardian approves the proposal a delay will starts example in security Council case upgradeStatus[id].securityCouncilApprovalTimestamp = uint48(block.timestamp)
a timestamp will be set to securityCouncilApprovalTimestamp
and when this delay passes the proposal will be ready to be executed now the proposal creator will be able to execute the proposal.
The problem occurs when the executor does not call ProtocolUpgradeHandler::execute
in this case the proposal will be in Ready state for ever without a way to make it expire.
The approveUpgradeSecurityCouncil function sets the securityCouncilApprovalTimestamp for a proposal when it is approved.
The upgradeState function determines the state of the proposal as follows:
If the securityCouncilApprovalTimestamp is not 0
, the proposal transitions to ExecutionPending
or Ready
based on whether the UPGRADE_DELAY_PERIOD has elapsed.
Once the proposal is ready, it can be executed by calling the execute function.
However, if the execute function is not called, the proposal remains in a Ready state forever, as there is no expiry mechanism to transition unexecuted proposals to an Done state.
After block.timestamp >= upg.securityCouncilApprovalTimestamp + UPGRADE_DELAY_PERIOD;
Proposals approved by the Security Council but not executed will remain in an indefinite "Ready" state.
This could lead to:
Stale proposals lingering in the system.
Malicious actor could propose an upgrade knowing he won't execute it now but after specific conditions are meet and leaving it in a "Ready" state. When specific conditions align (e.g: changes in the protocol), the actor could execute the proposal to exploit the system.
Modify the upgradeState
function to include a new "Expired" state:
Admin input validation, gas, missing events not related to bridges, NATSPEC, spellcheck, Address Zero, Indexed fields in Events, 0 impact, trusted admin/party action https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
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.