stake.link

stake.link
DeFiHardhatBridge
27,500 USDC
View results
Submission Details
Severity: low
Invalid

CONVERTING INT256 TO UINT256 CAN LEAD TO OVERFLOW ERRORS

Summary

contracts/core/ccip/SDLPoolCCIPControllerPrimary.sol#300

In particular, the line that raises concern is:
reSDLSupplyByChain[sourceChainSelector] += uint256(totalRESDLSupplyChange);

Vulnerability Details

This line takes an int256 value (totalRESDLSupplyChange) and converts it to uint256 before using it to modify a variable in reSDLSupplyByChain. The danger here lies in that if totalRESDLSupplyChange is negative, converting a negative number to uint256 can result in a large and unexpected number, as unsigned integers (uint) cannot represent negative numbers. This could cause unexpected behaviors or logical errors in the contract.

Impact

Overflow Attack

Tools Used

Audit Wizard, Slither, Chat GPT, Manual Review

Recommendations

The recommendation is to use clear constants or handle such conversions with greater caution, as converting signed integers to unsigned integers can be risky if not handled correctly.

Updates

Lead Judging Commences

0kage Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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