Inconsistency across multiple repaying functions causing lender to pay extra fees. #62
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
M-03
primary issue
Highest quality submission among a set of duplicates
🤖_primary
AI based primary recommendation
🤖_68_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarket.sol#L226
Vulnerability details
Impact
Inconsistency across multiple functions can cause borrower to pay extra fees
Proof of Concept
Within functions such as
repay
andrepayAndProcessUnpaidWithdrawalBatches
, funds are first pulled from the user in order to use them towards the currently expired, but not yet unpaid batch, and then the updated state is fetched.However, this is not true for functions such as
closeMarket
,deposit
,repayOutstandingDebt
andrepayDelinquentDebt
, where the state is first fetched and only then funds are pulled, forcing borrower into higher fees.This inconsistency will cause borrowers to pay extra fees which they otherwise wouldn't.
PoC:
and the logs:
Tools Used
Manual review
Recommended Mitigation Steps
Always pull the funds first and refund later if needed.
Assessed type
Context
The text was updated successfully, but these errors were encountered: