Closed howlbot-integration[bot] closed 1 month ago
This is not an issue (certainly not a high). The reason the other functions check isHooked
is because they are state-changing beyond the permissions update. onTransfer
and onDeposit
have the ability to mark an account as a known lender, while onQueueWithdrawal
can only update a lender's credentials (provided they have a valid credential to be updated / retrieved from a pull provider). The updating of credentials for a particular lender is not intended to be restricted in any way.
Interesting finding.
I will go with L because, while the path is viable, it is so under the condition that the providerAddress
provided in the hooks data was previously stored in the _roleProviders
mapping, so the caller can't avoid passing by a trusted gatekeeper for their call:
File: AccessControlHooks.sol
534: RoleProvider provider = _roleProviders[providerAddress];
535: if (provider.isNull()) return false;
3docSec changed the severity to QA (Quality Assurance)
3docSec marked the issue as grade-b
This previously downgraded issue has been upgraded by 3docSec
3docSec marked issue #11 as primary and marked this issue as a duplicate of 11
While well elaborated, the attack idea here is different than #11 and #83, and quite less likely/impactful because of https://github.com/code-423n4/2024-08-wildcat-findings/issues/26#issuecomment-2393174425 - for this reason I find fair to award only partial credit to this report
3docSec marked the issue as partial-50
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/AccessControlHooks.sol#L812-L825 https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/AccessControlHooks.sol#L704-L704 https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/AccessControlHooks.sol#L531-L561
Vulnerability details
AccessControlHooks::onQueueWithdrawal
do not checkmarket.isHooked
allowing anyone to call the function with arbitraryhooksData
Summary
AccessControlHooks::onQueueWithdrawal
has no access control in contrast to all other hooks, making it possible for an attacker to call_tryValidateAccess(status, lender, hooksData)
with arbitraryhooksData
.onQueueWithdrawal
directly, the attacker has access to_tryValidateAccess
which can update a lender status through_writeLenderStatus
_roleProviders
mapping can be called by the attacker to get credentials, even those who are not in the pull provider list and might be there only to grant access to specific priviledged users.msg.sender = hook
Vulnerability details
If we follow the call path:
onQueueWithdrawal
with arbitraryhooksData
(containing a selected role provider)_tryValidateAccess
is called_tryValidateAccessInner
is called_handleHooksData
is called and will returnhasValidCredential == true
if_tryValidateCredential
return true_tryValidateCredential
is calledhooksData
and called_writeLenderStatus
withcanSetKnownLender == true
, settingisKnownLenderOnMarket == true
for that market.isKnownLenderOnMarket == true
for the user, he can transfer market's tokens as theonTransfer
hook is skippedFor this to be possible step (7) is crucial, and require the provider to return valid credential to the caller, which is possible depending on the verification method used by that provider. The issue would not exist with an access control on the hook.
Under in normal circumstances, Lenders have 2 ways to validate their credential:
grantRole
with the Lender addresslastProvider
, by calling a hooked market function, the hook will go through a list ofPullProvider
to try validate his credentialsThanks to the missing access control on
onQueueWithdrawal
, a Lender can ask credential to any Provider that are not part of the list above, which might be special Providers that shouldn't be accessed by anyone, and might grant credential to the caller.Impact
Unrestricted access to any Provider by a Lender to try validate his credentials. Also quoting from the "Attack Ideas" section of the Readme :
Tools Used
Manual review
Recommended Mitigation Steps
Assessed type
Invalid Validation