The function transfer_from_contract() does not implement any access control, allowing anyone to move funds directly from the contract’s resource account.
Normal behavior: The function should only be callable by owner to transfer tokens from the contract’s balance to users.
Issue: The function is declared public without restriction. It uses the stored signer_cap to create a signer for the contract’s resource account and then calls coin::transfer. Since there is no only_owner/access check, any external caller can execute this function and withdraw funds.
Likelihood: High
Reason 1 // The function is callable by any external user since no restriction is enforced.
Reason 2
Impact: High
Impact 1 Unauthorized draining of the contract’s entire AptosCoin balance.
Impact 2
Attacker can call fun transfer_from_contract
Attacker chooses their own address as to
keeps calling until balance is drained
use Access control assert!(signer::address_of(owner) == state.owner, E_NOT_OWNER);
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.