The Layer 2 bridge contract will whitelist a contract if it is not already whitelisted when withdraw_auto_from_l1
is called. However, it does not check whether whitelisting is enabled.
This issue affects the StarkNet contract, but it also impacts the Ethereum contract.
The _white_list_collection
function can be triggered by an admin or when the bridge contract on Layer 2 receives calls from l1_handler
. However, it lacks a check to verify whether whitelisting is enabled.
In the above code, we only check if the collection is whitelisted. If it is not, we whitelist it. However, the intended behavior is that if whitelisting is not enabled, any token should be allowed to be bridged.
From the above function, it can be seen that if whitelisting is not enabled, we return true
.
The collection is added to the whitelist when whitelisting is not enabled, which is not the intended behavior according to the given code.
Whitelisting can be disabled, which allows any user to bridge their tokens. If many token collections are added while whitelisting is not enabled, it could create a DoS for new collections due to the loop used in _white_list_collection
. This issue affects both Ethereum and StarkNet contracts.
Manual Review
In the _white_list_collection
function, check if whitelisting is not enabled. If so, do not add the collection to the whitelist and simply return.
Likelyhood: High, once the whitelist option is disabled, collections will grow. Impact: High, withdraw won’t be possible because of Out-Of-Gas.
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.