Submitted by gesha17, also found by falconhoof, kutugu, and Infect3d
The onQueueWithdrawal() function does not check if the caller is a hooked market, meaning anyone can call the function and attempt to verify credentials on a lender. This results in calls to registered pull providers with arbitrary hookData, which could lead to potential issues such as abuse of credentials that are valid for a short term, e.g. 1 block.
The onQueueWithdrawal() function does not check if the msg.sender is a hooked market, which is standart in virtually all other hooks:
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/AccessControlHooks.sol#L812
If the caller is not a hooked market, the statement !isKnownLenderOnMarket[lender][msg.sender], will return true, because the lender will be unknown. As a result the _tryValidateAccess() function will be executed for any lender and any hooksData passed. The call to _tryValidateAccess() will forward the call to _tryValidateAccessInner(). Choosing a lender of arbitrary address, say address(1) will cause the function to attempt to retrieve the credential via the call to _handleHooksData(), since the lender will have no previous provider or credentials.
As a result, the _handleHooksData function will forward the call to the encoded provider in the hooksData and will forward the extra hooks data as well, say merkle proof, or any arbitrary malicious data.
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/AccessControlHooks.sol#L617
The function call will be executed in tryValidateCredential(), where the extra hookData will be forwarded. As described in the function comments, it will execute a call to provider.(address account, bytes calldata data).
This means that anyone can call the function and pass arbitrary calldata. This can lead to serious vulnerabilities as the calldata is passed to the provider.
Consider the following scenario:
By following this scenario, a malicious user can essentially DoS a specific type pull provider.
Depending on implemenation of the pull provider, this can lead to other issues, as the malicious user can supply any arbitrary hookData in the function call.
Require the caller to be a registered hooked market, same as onQueueWithdrawal() in FixedTermloanHooks
3docSec (judge) commented via duplicate issue #83:
laurenceday (Wildcat) acknowledged and commented:
For this audit, 22 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by Bauchibred received the top score from the judge.
The following wardens also submitted reports: K42, Infect3d, 0xriptide, 0xpiken, falconhoof, shaflow2, Takarez, 0xNirix, kutugu, NexusAudits, Udsen, Bigsam, air_0x, Atarpara, 0x1771, 0xastronatey, deadrxsezzz, pfapostol, saneryee, inh3l, and gesha17.
