You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
sherlock-admin opened this issue
May 23, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
USSDRebalancer.sol#SellUSSDBuyCollateral will not sell any collateral if the collateralFactor is too high
Summary
USSDRebalancer.sol#SellUSSDBuyCollateral will not sell any collateral if the collateralFactor is too high. Cause after the USSD price rises, it cannot be adjusted.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
J4de
high
USSDRebalancer.sol#SellUSSDBuyCollateral
will not sell any collateral if thecollateralFactor
is too highSummary
USSDRebalancer.sol#SellUSSDBuyCollateral
will not sell any collateral if thecollateralFactor
is too high. Cause after the USSD price rises, it cannot be adjusted.Vulnerability Detail
1. The vulnerability
If the
collateralFactor
exceeds allflutterRatios
, the for loop will not break, and finallyflutter
will accumulate toflutterRatios.length
.collateral[i].ratios[flutterRatios.length]
is0
(Because the index exceeds the upper limit of the array). So no collateral will be sell.2. How to make the
collateralFactor
biggerto call
mintForToken
function to mint USSD, The collateralFactor will get bigger.Impact
SellUSSDBuyCollateral
fucntion no longer works in some scenariosCode Snippet
https://github.com/USSDofficial/ussd-contracts/blob/f44c726371f3152634bcf0a3e630802e39dec49c/contracts/USSDRebalancer.sol#L180-L184
Tool used
Manual Review
Recommendation
Duplicate of #889
The text was updated successfully, but these errors were encountered: