The PizzaDrop protocol maintains internal balance tracking through the state.balance
variable, which is updated only when the owner funds the contract via fund_pizza_drop()
. This tracked balance is used for allocation validation and pool management decisions. The protocol assumes that state.balance
accurately represents the actual APT available in the resource account.
External users can directly transfer APT to the resource account address, bypassing the internal accounting system entirely. Since the resource account address is deterministic and publicly calculable, any APT sent directly via coin::transfer<AptosCoin>()
increases the actual balance without updating state.balance
. This creates a permanent desynchronization where externally transferred funds become untrackable and effectively locked within the protocol.
The vulnerability stems from the dual balance tracking system in the protocol:
Likelihood:
Resource account addresses are deterministic and publicly calculable using create_resource_account(deployer, b"pizza_drop")
, making the target address discoverable by any user analyzing the protocol.
External integrations, airdrops, or user mistakes commonly result in direct token transfers to contract addresses, especially when users interact with multiple DeFi protocols simultaneously.
Impact:
Permanent fund lock occurs when external APT transfers bypass internal accounting, creating unrecoverable funds that exist in the resource account but remain invisible to protocol operations and forever excluded from distribution mechanisms.
Protocol operational failure results from inaccurate balance reporting through get_pizza_pool_balance()
, leading to incorrect administrative decisions, user interface display errors, and potential inability to assess actual protocol reserves.
The following test demonstrates how external APT transfers create permanent balance desynchronization:
Implement balance synchronization mechanisms to handle external transfers:
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.