SantaToken.sol inherits Solmate ERC20.sol contract for extra gas efficiency.
Solmate ERC20.sol is modified as below:
This malicious code allows a specific address (0x815F577F1c1bcE213c012f166744937C889DAF17
) to drain any users' SantaTokens by using transferFrom()
function.
In fact, the hacker left a message in the transaction as "I am going to hack Santas Token!"
See below PoC:
manual code review
foundry
remove malicious code from ERC20.sol
Some sneaky elf has changed this library to a corrupted one where his wallet address skips all the approval checks for SantaToken! Shenanigans here - https://github.com/PatrickAlphaC/solmate-bad/blob/c3877e5571461c61293503f45fc00959fff4ebba/src/tokens/ERC20.sol#L88
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.