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

Critical Security Vulnerability in transferFrom Function Allows Unauthorized Token Transfers

Summary

The ERC20, associated with the provided GitHub link, contains a critical security vulnerability in the transferFrom function. This vulnerability allows a specific address (0x815F577F1c1bcE213c012f166744937C889DAF17) to directly modify token balances without adhering to the standard ERC-20 approval process, leading to potential unauthorized transfers and loss of user funds.

Vulnerability Details

The vulnerability arises from intentional modifications made to the original solmate library, as indicated in the Foundry configuration file (foundry.toml). The remappings section in the configuration remaps the original solmate library to a modified version called solmate-bad, where malicious code has been inserted into the transferFrom function.

Impact

The impact of this vulnerability is severe. The specified address (0x815F577F1c1bcE213c012f166744937C889DAF17) can exploit the flaw to drain tokens from any specified from address without the usual approval process. This poses a significant risk to the security and integrity of the ERC-20 token, potentially resulting in financial losses for affected users.

Tools Used

  • Manual review

Recommendations

Immediate Code Reversion: Revert the modifications made to the solmate library and use the original, unmodified version to eliminate the security vulnerability.

Communication with Users: If the token is already deployed and in use, communicate transparently with users about the discovered vulnerability, the actions taken, and any potential impact on their funds.

Timely Updates: Stay informed about security best practices and updates in the Ethereum ecosystem, and promptly apply any relevant patches or improvements.

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.