Closed c4-submissions closed 11 months ago
bytes032 marked the issue as insufficient quality report
GalloDaSballo (sponsor) disputed
Disagree that it has any impact
sounds like it might work when cold start. But definitely not a high. pls provide a poc which shows reward lost > 1 eth
jhsagd76 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/CdpManager.sol#L621
Vulnerability details
Impact
If
_totalEBTCSupply
>_ETHDrawn
or_price
it may result in truncation error , since there is no access control on the function someone having access to it can make the input values, they can put any arguments valueProof of Concept
for example i>:
_totalEBTCSupply
= 10_ETHDrawn
= 5_price
= 2 then redeemedEBTCFraction becomes1
for example ii>:
_totalEBTCSupply
= 11_ETHDrawn
= 4_price
= 2 then redeemedEBTCFraction becomes0
Due to this
newBaseRate
will change, sincebeta = 2
& this might also result in truncation error. So baseRate will be updated wrongly.Tools Used
VS Code
Recommended Mitigation Steps
Add a modifier check only for specific admin to access the function for entering the correct values or else add a check for _totalEBTCSupply for not resulting in truncation error.
Assessed type
Math