Starknet doesn’t ensure that values that are valid now, won’t be changed in the future, so having MAX_PAYLOAD_LENGTH
as a constant can make the Bridge
contracts less functional in case payload size gets modified.
Looking at the Starknet docs, in the table with current limits we will see the following sentence:
These are subject to revisions and change on a regular basis
But the Bridge
contract has no setter function for the max payload length, leading to future issues. The biggest impact will be caused if the max payload is decreased by Starknet
. Valid depositTokens
will lead to failed transactions and NFTs will be locked in the bridge contract. This will happen with each transaction with a payload bigger than the current limit on Starknet but lower than MAX_PAYLOAD_LENGTH
.
The other way around is when payload size is increased, then MAX_PAYLOAD_LENGTH
will prevent users with a lot of tokens from bridging them to L2 while this request is now valid and will force them to pay more bridge fees by executing multiple bridge transactions.
Less functional bridge when payload size is updated from Starknet, due to using hardcoded MAX_PAYLOAD_LENGTH
variable
Manual Review
Add setter function for the max payload length and modify it when Starknet modifies it as well.
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.
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.