Closed howlbot-integration[bot] closed 1 month ago
This is the intended behavior (and this scenario is precisely why the isKnownLender status exists). If an account is a known lender, they should always be able to purchase market tokens from other accounts. They can still be blocked from depositing, as borrowers should never be forced to accept funds from third parties they do not wish to receive money from, but if they have previously passed the borrower's KYC requirements they should always have the ability to receive tokens from other lenders.
The scenario in which this is relevant is when a market becomes delinquent and there exist some lenders who have sufficient assets in the market to make pursuing legal action worthwhile, while other lenders have an amount that would only make sense to write off as a loss. Allowing known lenders to transfer their tokens to each other means that a larger depositor has the ability to buy up the other lenders' claims on the debt at a discount and pursue a lawsuit that wouldn't make sense as a class action or a hundred different claims for $5k.
Marking as intended behavior
3docSec marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/access/AccessControlHooks.sol#L769-L804
Vulnerability details
Proof of Concept
There is a inconsistency in how the isBlockedFromDeposits status is checked between deposit and transfer functions in the Wildcat Market contracts. This inconsistency allows known lenders who are blocked from deposits to bypass this restriction by receiving transfers, effectively allowing them to increase their position when they shouldn't be able to.
In the deposit function (via onDeposit in AccessControlHooks.sol), the blocked status is always checked:
However, in the transfer function (via onTransfer in AccessControlHooks.sol), the blocked status is only checked for non-known lenders:
Exploit scenario:
This inconsistency undermines the purpose of the access control system and could potentially be exploited to circumvent market restrictions.
Recommended Mitigation Steps
Apply consistent access control in both deposit and transfer functions.
Assessed type
Access Control