state.balance
is manual bookkeeping and can easily drift from the true on-chain balance (coin::balance<AptosCoin>(resource_addr)
).
Anyone can transfer APT directly into the resource account, inflating the actual coin balance but not updating state.balance
.
Likelihood:
Any external actor can send coins to the resource account outside the contract.
Owner mistakes can also desync accounting.
Impact:
Internal state may show insufficient funds, blocking legitimate claims even when APT is available.
Or, it may allow over-claims if state.balance
is higher than reality.
Attacker sends APT directly to the resource account.
get_actual_apt_balance()
returns higher than state.balance
.
Contract logic misreports balances, leading to inconsistencies.
Instead of updating the balance using state.balance value and then updating using amount value, we should use the balance of tokens on the Aptos blockchain instead of manually updating the balance everytime and tracking it manually.
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.