Closed howlbot-integration[bot] closed 1 month ago
We wouldn't consider this a medium as it doesn't impact the functionality of the protocol, it's just a minor inconvenience in that borrowers need to handle resetting the reserve ratio upon expiry.
See here: https://github.com/code-423n4/2024-08-wildcat-findings/issues/46#issuecomment-2367760017 - this issue is effectively a duplicate.
That said, in retrospect it's good to have pointed out and worth fixing, so probably best to just merge them into one finding.
Would happily accept as QA, but leaving severity decision to the judge: disputing on that basis alone rather than validity.
3docSec marked the issue as duplicate of #46
3docSec changed the severity to QA (Quality Assurance)
3docSec marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/access/MarketConstraintHooks.sol#L227
Vulnerability details
Proof of Concept
The onSetAnnualInterestAndReserveRatioBips function in the MarketConstraintHooks contract exhibits inconsistent behavior when handling interest rate changes after the expiry of an initial temporary reserve ratio period. This inconsistency can lead to unexpected reserve ratio calculations
Two scenarios demonstrate this issue: Scenario 1: Further lowering the interest rate after expiry
In this scenario, when the interest rate is lowered further, the function uses the original values from when the temporary reserve ratio was first set (potentially 2 weeks ago) to calculate the new temporary reserve ratio. This could result in a higher reserve ratio than current market conditions might warrant.
Scenario 2: Slightly increasing then lowering the interest rate after expiry Step 1 (slight increase):
Step 2 (subsequent decrease):
In this scenario, the slight increase causes the temporary excess reserve ratio to be deleted. When the interest rate is subsequently lowered, it's treated as a new case, using current levels for calculations instead of the values from 2 weeks ago.
This inconsistency can lead to:
Recommended Mitigation Steps
temporaryExcessReserveRatio should be removed after expiry and a fresh one initiated if needed.
Assessed type
Other