Closed howlbot-integration[bot] closed 1 month ago
This is incorrect - the signature of the internal function is different because the base calldatasize is used to derive the offset to extraData
which then gets passed in to the external function call. Also the suggested solution is just a naming fix, it's unrelated to the issue you described.
3docSec marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/types/HooksConfig.sol#L374-L426 https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/market/WildcatMarketWithdrawals.sol#L255 https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/access/AccessControlHooks.sol#L133 https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/access/FixedTermLoanHooks.sol#L873
Vulnerability details
Impact
onExecuteWithdrawal
function is incorrectly encoded in HooksConfig.sol and as a result, transactions that use the hook will not be successfully executed.Proof of Concept
From the IHooks interface,
onExecuteWithdrawal
is defined as follows using a uint128normalizedAmountWithdrawn
parameter.However, when encoding in HooksConfig.sol, we see that a uint256
scaledAmount
parameter is passed in instead.Also, while encoding the parameters, the
onExecuteWithdrawal
selector is gotten using the interface, but the uint256 scaled amount offset is written into the call data instead.This causes that the defined function selector be different from its expected arguments and as such the hook fails.
Tools Used
Manual code review
Recommended Mitigation Steps
Assessed type
Context