Submitted by pfapostol, also found by Infect3d
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/access/AccessControlHooks.sol#L220
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/access/FixedTermLoanHooks.sol#L254
The Documentation suggests that a role provider can be a push provider (one that pushes credentials into the hooks contract by calling grantRole) and a pull provider (one that the hook calls via getCredential or validateCredential).
The documentation also states that:
But in fact, only the initial deployer can be an EOA provider, since it is coded in the constructor. Any other EOA provider that the borrower tries to add via addRoleProvider will fail because it does not implement the interface.
PoC will revert because EOA does not implement interface obviously:
Replace the interface call with a low-level call and check if the user implements the interface in order to be a pull provider:
With this code all logic works as expected, for EOA providers pullProviderIndex is set to type(uint24).max, for contracts - depending on the result of calling isPullProvider:
laurenceday (Wildcat) commented:
3docSec (judge) commented:
