repay
opearation can be effectively simulated bypassing state.isClosed
and hooks
#20
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
insufficient quality report
This report is not of sufficient quality
🤖_primary
AI based primary recommendation
🤖_117_group
AI based duplicate group recommendation
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/WildcatMarket.sol#L202-L215
Vulnerability details
Impact
It bypasses
state.isClosed
and nullifies any hook forrepay
operation. Also it breaks one of the invariants underAll Markets
.Proof of Concept
According to the implementation of
repay
function, it should revert when eitherstate.isClosed
is true orhooks.onRepay
fails.However, user can effectively make the same effect bypassing above revert conditions by:
WildcatMarket.updateState()
This bypasses any reverting situation that should happen with
state.isClosed
or hook. Considering we'd have more hook templates that may utilizeonRepay
for some extended monitoring, it could arise as a bigger issue.Furthermore, it breaks the invariant under
All Markets
:Tools Used
Manual Review
Recommended Mitigation Steps
Revise the repayment mechanism to ensure it is processed exclusively through designated market functions and strictly complies with any conditions that may cause it to revert.
Assessed type
Access Control
The text was updated successfully, but these errors were encountered: