https://github.com/Cyfrin/2024-07-ark-project/blob/main/apps/blockchain/starknet/src/bridge.cairo#L9
The StarklaneMessaging
contract contains a vulnerability in its collection whitelisting mechanism. This issue could potentially allow unauthorized actors to bypass whitelist restrictions and perform operations that should be restricted to whitelisted collections only.
The vulnerability arises due to improper access controls and weak verification of the whitelist status. Specifically:
Inadequate Access Control: The white_list_collection
function, which modifies the whitelist, does not enforce strict access controls, allowing unauthorized entities to add or remove collections from the whitelist.
Weak Whitelist Verification: The is_white_listed
function may not sufficiently verify the whitelist status, potentially allowing unauthorized collections to bypass restrictions
An attacker could potentially add malicious collections to the whitelist, which could then be used to execute restricted operations
An attacker could remove legitimate collections from the whitelist, preventing authorized operations from being executed.
To demonstrate the bypass, first, deploy the StarklaneMessaging
contract and then use a contract account or an external tool to call the white_list_collection
function with an unauthorized address
}
Manual Review
Implement Strict Access Controls:
Ensure that only authorized accounts (e.g., the contract owner or admin) can call functions that modify the whitelist. Add proper access control checks to the white_list_collection
function.
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.