Underflow due to incorrect comparison #433
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-766
satisfactory
satisfies C4 submission criteria; eligible for awards
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-amm/UlyssesPool.sol#L260
Vulnerability details
Underflow due to incorrect comparison
leftOverBandwidth is underflowed due to incorrect comparison of oldTotalWeights and newTotalWeights.
Proof of Concept
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-amm/UlyssesPool.sol#L260
Here initially consider this check oldTotalWeights > newTotalWeights, and calculate the
Due to above condition ,
Its meaning ,
So eventually ,
Initial value is leftOverBandwidth is zero. So leftOverBandwidth is going to be negative then its reverted.
Tools Used
Vs code
Recommended Mitigation Steps
Use
Assessed type
DoS
The text was updated successfully, but these errors were encountered: