A borrower cannot prevent the transfer of market tokens if the market allows deposits only when the lenders have valid credentials #24
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-a
primary issue
Highest quality submission among a set of duplicates
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_44_group
AI based duplicate group recommendation
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/access/FixedTermLoanHooks.sol#L893-L923
Vulnerability details
Impact
A borrower cannot prevent the transfer of market tokens if the market allows deposits only when the lenders have valid credentials
Proof of Concept
The Wildcat protocol states that a borrower can disable the token transferring function when deploying a new market
https://docs.wildcat.finance/using-wildcat/day-to-day-usage/borrowers#market-type:
https://docs.wildcat.finance/using-wildcat/day-to-day-usage/lenders#making-deposits:
In most cases, it is the most fundamental requirement that a lender can deposit their assets into the market only when they have valid credentials.
However, a borrower can not deploy a market which disables the token transferring function while requires lenders having valid credentials for deposit.
We can deep dive
FixedTermLoanHooks#onTransfer()
for detail:onTransfer()
can revert only whentransferRequiresAccess
istrue
and the lender has no valid credential (hasValidCredential
isfalse
)However, it a lender has no valid credential, they can not deposit their assets as long as the market requires lenders having any valid credentials for deposit.
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/FixedTermLoanHooks.sol#L835-L837:
If we take a look at
AccessControlHooks.sol
, we can find that it doesn't support disabling token transfer function at all.Tools Used
Manual review
Recommended Mitigation Steps
isTransferDisabled
should be introduced to config a market , which will be initialized in_onCreateMarket()
, and used for token transfer control:Assessed type
Access Control
The text was updated successfully, but these errors were encountered: