Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2023-05-juicebox/blob/main/juice-buyback/contracts/JBXBuybackDelegate.sol#L159 https://github.com/code-423n4/2023-05-juicebox/blob/main/juice-buyback/contracts/JBXBuybackDelegate.sol#L279
The payParams() function takes the _data parameter, which contains the reservedRate. If reservedRate exceeds MAX_RESERVED_RATE, then this causes _nonReservedToken to be incremented. This results in a decrease in assets and a larger mint.
JBConstants.MAX_RESERVED_RATE = 10000; _nonReservedToken = PRBMath.mulDiv( _amountReceived, 10000 - _reservedRate, 10000 ); If _reservedRate > 10000 -> _nonReservedToken = 0
controller.mintTokensOf(..) use _useReservedRate: true
Manual Review / VSCode
Check the parameter in the payParams() function. require(_data.reservedRate<MAX_RESERVED_RATE)
Invalid Validation
spam / overinflated
dmvt marked the issue as low quality report
dmvt marked the issue as unsatisfactory: Overinflated severity
Lines of code
https://github.com/code-423n4/2023-05-juicebox/blob/main/juice-buyback/contracts/JBXBuybackDelegate.sol#L159 https://github.com/code-423n4/2023-05-juicebox/blob/main/juice-buyback/contracts/JBXBuybackDelegate.sol#L279
Vulnerability details
Impact
The payParams() function takes the _data parameter, which contains the reservedRate. If reservedRate exceeds MAX_RESERVED_RATE, then this causes _nonReservedToken to be incremented. This results in a decrease in assets and a larger mint.
Proof of Concept
JBConstants.MAX_RESERVED_RATE = 10000; _nonReservedToken = PRBMath.mulDiv( _amountReceived, 10000 - _reservedRate, 10000 ); If _reservedRate > 10000 -> _nonReservedToken = 0
controller.mintTokensOf(..) use _useReservedRate: true
Tools Used
Manual Review / VSCode
Recommended Mitigation Steps
Check the parameter in the payParams() function. require(_data.reservedRate<MAX_RESERVED_RATE)
Assessed type
Invalid Validation