Open code423n4 opened 1 year ago
thereksfour marked the issue as primary issue
I think all pool tokens would need to be redeemed (not just those held by StargateRewardableWrapper
) and therefore this feels more like low severity / QA. However the change is worth making.
tbrent marked the issue as disagree with severity
@bin2chen66 Please take a look
@thereksfour agree, it's ok
thereksfour changed the severity to QA (Quality Assurance)
Lines of code
https://github.com/reserve-protocol/protocol/blob/9ee60f142f9f5c1fe8bc50eef915cf33124a534f/contracts/plugins/assets/stargate/StargatePoolFiatCollateral.sol#L112
Vulnerability details
Impact
StargatePoolFiatCollateral.refPerTok()
May return 0, resulting in a price of (0,0)Proof of Concept
In
StargatePoolFiatCollateral.refPerTok()
, if _totalSupply == 0, rate = 0 is returned.If
refPerTok() == 0
it causestryPrice()
to return(0,0)
.(0, 0) is a valid price
.which may cause the price to be wrong, and may cause
savedLowPrice
to be wrong as well.Tools Used
Recommended Mitigation Steps
If
_totalSupply==0
, returnFIX_ONE
.Assessed type
Context