#49970 [SC-Insight] Malicious upgradable admin can permanently brick contract upgradeability
Description
Description
@abimethod
def schedule_contract_upgrade(self, program_sha256: Bytes32, timestamp: UInt64) -> None:
"""Schedule the upgrade of the contract.
Args:
program_sha256 (Bytes32): The SHA256 of the new program
timestamp (UInt64): The timestamp to schedule the upgrade
Raises:
AssertionError: If the contract is not initialised
AssertionError: If the caller does not have the upgradable admin role
AssertionError: If the timestamp is not sufficiently in the future
"""
self._only_initialised()
self._check_sender_role(self.upgradable_admin_role())
# ensure timestamp is sufficiently in the future
@>> self._check_schedule_timestamp(timestamp)
# schedule contract upgrade, possibly overriding existing scheduled upgrade
self.scheduled_contract_upgrade.value = ScheduledContractUpgrade(program_sha256.copy(), ARC4UInt64(timestamp))
emit(UpgradeScheduled(program_sha256, ARC4UInt64(timestamp)))Impact Details
Recommendations
Proof of Concept
Proof of Concept
Previous#49938 [SC-Low] Underflow Revert in `remove_item` When Removing from an Empty ArrayNextFolks Finance Wormhole NTT on Algorand
Was this helpful?