The SantaToken
contract inherits from solmate-bad/ERC20
contract, which has a backdoor hidden inside transferFrom()
method. This backdoor allows the Elves' address 0x815F577F1c1bcE213c012f166744937C889DAF17
to transfer the tokens between two arbitrary accounts without checking allowance. Effectively, this means that the protocol can be rug-pulled and all the tokens may get stolen by the Elves.
The ERC20::transferFrom()
method, in addition to the standard, expected logic, contains the following block of code:
If the msg.sender
is the Elves' address, the transfer will be executed without checking for allowances. That means that the owner of the address can freely move any amount of SantaTokens
between any arbitrary accounts.
This obviously opens a rug-pull attack vector. The Elves, at some point, can simply steal the tokens from all of the protocol's users and transfer them to their own account.
Tokens can get stolen, protocol can get rug-pulled
Manual review
Remove the backdoor from the ERC20::transferFrom()
method:
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.