-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setWeight() Logic error #766
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
H-03
primary issue
Highest quality submission among a set of duplicates
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Comments
code423n4
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
labels
Jul 5, 2023
c4-judge
added
the
primary issue
Highest quality submission among a set of duplicates
label
Jul 9, 2023
trust1995 marked the issue as primary issue |
c4-judge
added
the
satisfactory
satisfies C4 submission criteria; eligible for awards
label
Jul 11, 2023
trust1995 marked the issue as satisfactory |
0xLightt marked the issue as sponsor confirmed |
c4-sponsor
added
the
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
label
Jul 12, 2023
c4-judge
added
the
selected for report
This submission will be included/highlighted in the audit report
label
Jul 25, 2023
trust1995 marked the issue as selected for report |
This was referenced Jul 26, 2023
c4-judge
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
and removed
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
labels
Jul 27, 2023
trust1995 changed the severity to 3 (High Risk) |
We recognize the audit's findings on Ulysses AMM. These will not be rectified due to the upcoming migration of this section to Balancer Stable Pools. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
H-03
primary issue
Highest quality submission among a set of duplicates
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/54a45beb1428d85999da3f721f923cbf36ee3d35/src/ulysses-amm/UlyssesPool.sol#L223
Vulnerability details
Impact
Logic error
Proof of Concept
setWeight()
Used to set the new weightThe code is as follows:
There are several problems with the above code
if (oldTotalWeights > newTotalWeights)
should be changed toif (oldTotalWeights < newTotalWeights)
because the logic inside the if is to calculate the case of increasingweight
poolState.bandwidth = oldBandwidth.mulDivUp(oldTotalWeights , newTotalWeights).toUint248();
should be modified to
poolState.bandwidth = oldBandwidth.mulDivUp(newTotalWeights, oldTotalWeights).toUint248();
Because this calculates the extra number
leftOverBandwidth
has a problem with the processing logicTools Used
Recommended Mitigation Steps
Assessed type
Context
The text was updated successfully, but these errors were encountered: