Normal behavior: Only the contract owner can register pizza lovers by calling register_pizza_lover
, which checks ownership and then calls get_random_slice
to assign a random amount. Users must be registered by the owner before they can claim their slice.
Issue: The get_random_slice
function is marked as entry
, making it directly callable by any user. This allows users to bypass the owner's registration control and register themselves for the airdrop, then immediately claim their slice without owner approval.
Likelihood:
Any user can directly call get_random_slice
as an entry function, completely bypassing the intended registration flow controlled by the owner.
Users will discover this vulnerability quickly since the function is callable and provides immediate benefit (self-registration for airdrop).
Impact:
Complete bypass of access control: unauthorized users can register anyone and drain the airdrop pool without owner consent.
Economic loss: the airdrop pool can be completely drained by malicious users before legitimate users (registered by owner) can claim their slices.
This test shows how a user can assign themself as eligible for the airdrop, and claim their slice:
Move the check that verify caller is owner in this 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.