An incorrect value of state.isDelinquent might impact the functionality of hook operations. #21
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-18
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarketBase.sol#L542
Vulnerability details
Impact
By using an incorrect value for
state.isDelinquent
, hook operations may produce unexpected outcomes.Proof of Concept
As market operations occur, we can generally assume they follow these steps:
As outlined,
state.isDelinquent
isn't updated until_writeState
is executed, yet it is referenced during steps 1-3. Throughout the codebase, we ensure that steps 1-3 do not rely on thestate.isDelinquent
value in a way that would lead to incorrect operations.However, since hook templates are dynamically added by the protocol and markets will use them for extended hook monitoring, it is imperative to pass the correct value to hook functions that accurately reflects the current state.
Tools Used
Manual Review
Recommended Mitigation Steps
Update
state.isDelinquent
in_getUpdatedState
function:Assessed type
Error
The text was updated successfully, but these errors were encountered: