The mint
function should only allow authorized entities (specifically the battle_addr::streets
module as declared in the friend relationship) to create new CRED tokens. The function should verify that the caller has legitimate authority to mint tokens by checking that the capabilities are accessed from the correct storage location under the module owner's account
The critical issue is that the mint
function accepts module_owner: &signer
as a parameter but performs no validation to ensure this signer actually possesses the minting capabilities or represents the legitimate module owner. An attacker can call this function through the friend module while passing any arbitrary signer reference as the first parameter. The function then attempts to borrow capabilities from the address of this arbitrary signer rather than from the fixed module owner address (@battle_addr
), allowing unauthorized minting if any account happens to have CredCapabilities stored under it, or causing the transaction to abort if not, but still representing an access control bypass attempt.
Likelihood:
This vulnerability triggers when any friend module calls the mint
function and passes an arbitrary &signer
parameter instead of being restricted to using only the module owner's signer.
Impact:
An attacker can mint unlimited CRED tokens by providing a malicious signer reference that points to an address containing stolen or improperly stored minting capabilities.
The POC has been added reflecting the mint function accepts arbitrary signer inputs without owner validation, allowing any account to attempt minting operations as demonstrated by the test successfully compiling and executing with an attacker's signer instead of the legitimate owner's.
Remove the module_owner: &signer
parameter entirely
Hardcode @battle_addr
as the capabilities location
Add account registration instead of burning tokens for unregistered accounts
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.
The contest is complete and the rewards are being distributed.