Attacker can spend all the allowances approved to SantaList contract by all users. tAnd Attacker will get him self present rather than the user.
A user will approve his SantaTokens to SantaList
contract. Attacker can call buyPresent()
function with any user address who approved to spend their SantaTokens to SantaList contract. In result the user SantaTokens will be burned and Attacker will get the present not the user.
All users tokens who approved their SantaTokens to SantaList contract will be lost
Attacker can mint presents with someone's SantaTokens who approved SantaList to spend.
Proof of Code :
Add this test to SantasListTest.t.sol
and run forge test --mt testMintPresentsOfSomeone
to run the test.
Manual Review
There should an allowance check mechanism in the buyPresent function. The user should approve the other user addresses instead of SantasList
Contract.
Current implementation allows a malicious actor to burn someone else's tokens as the burn function doesn't actually check for approvals.
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.