likelihood: low
impact: very high
As opposed to solidity UUPSUpgradeability pattern, the starknet bridge.cairo
contract can be upgraded to a class hash of a contract that is non upgradeable. if this happens to be a bad/wrong class hash, all tokens held by the bridge would be lost for good. Similarly if the erc721_bridgeable.cairo
is upgraded to a wrong unupgradeable class hash, the contract might become bricked and all tokens lost.
Solidity uups upgradeability pattern ensures that upgrades can only be made to new uups implementations
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/1edc2ae004974ebf053f4eba26b45469937b9381/contracts/proxy/utils/UUPSUpgradeable.sol#L138
basically ensuring you dont mistakingly upgrade to a non upgradeable contract.
It is much better to revoke ownership of a contract than to upgrade to a non upgradeable version.
Something similar should be done with the cairo smart contracts. Currently there are no similar checks in the affected cairo contracts
if the l2 bridge.cairo
contract is mistakingly upgraded to the wrong class hash, it would lead to the loss of all the nfts held by the contract. Similarly, if the erc721_bridgeable.cairo
contracts are upgraded to the wrong class hash, the nft contract affected would be lost.
if this mistake is made, the damage will be irreparable
. and this mistake has been made before.
We can do something like this for both bridge.cairo
and erc721_bridgeable.cairo
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.