Skip to content

Fix: Integer overflow vulnerability in recipient balance updates#32

Merged
mudgen merged 1 commit into
Perfect-Abstractions:mainfrom
adamgall:fix/overflow-protection
Oct 21, 2025
Merged

Fix: Integer overflow vulnerability in recipient balance updates#32
mudgen merged 1 commit into
Perfect-Abstractions:mainfrom
adamgall:fix/overflow-protection

Conversation

@adamgall

Copy link
Copy Markdown
Collaborator

Fixes #26

Recipient balance additions were inside unchecked blocks, allowing potential overflow attacks where an attacker could overflow a recipient's balance to zero, effectively stealing tokens.

This fix moves all recipient balance additions outside unchecked blocks in both ERC20Facet and LibERC20, enabling Solidity's built-in overflow protection.

Affected functions:

  • ERC20Facet: transfer(), transferFrom()
  • LibERC20: mint(), transfer(), transferFrom()

Recipient balance additions were inside unchecked blocks, allowing potential
overflow attacks where an attacker could overflow a recipient's balance to zero,
effectively stealing tokens.

This fix moves all recipient balance additions outside unchecked blocks in both
ERC20Facet and LibERC20, enabling Solidity's built-in overflow protection.

Affected functions:
- ERC20Facet: transfer(), transferFrom()
- LibERC20: mint(), transfer(), transferFrom()
@mudgen mudgen merged commit f679cc1 into Perfect-Abstractions:main Oct 21, 2025
@adamgall adamgall deleted the fix/overflow-protection branch October 21, 2025 17:55
JackieXu pushed a commit to JackieXu/Compose that referenced this pull request Nov 6, 2025
…-protection

Fix: Integer overflow vulnerability in recipient balance updates
maxnorm added a commit that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critical: Unchecked arithmetic allows balance overflow in transfers

2 participants