Two functions with the same name and parameter types are defined in different contracts(WiseLending.sol and AaveHub.sol), leading to ambiguity in function invocation.
When invoking a function with the shared name and parameter types, Solidity cannot uniquely identify which function to call based solely on the function signature. This ambiguity may result in unintended behavior or errors during function execution.
Proof of Concept
In foundry, use
cast sig "withdrawExactAmountETH(uint256, uint256)"
0x99080e70
``
Tools Used
Manual review and foundry
Recommended Mitigation Steps
To avoid ambiguity in function invocation, use distinct function names or parameter types for functions located in different contracts. Alternatively, consider varying the function's visibility or state mutability along with the parameter types to achieve function overloading if necessary.
Lines of code
https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/WiseLending.sol#L636 https://github.com/code-423n4/2024-02-wise-lending/blob/79186b243d8553e66358c05497e5ccfd9488b5e2/contracts/WrapperHub/AaveHub.sol#L238
Vulnerability details
Impact
Two functions with the same name and parameter types are defined in different contracts(WiseLending.sol and AaveHub.sol), leading to ambiguity in function invocation.
When invoking a function with the shared name and parameter types, Solidity cannot uniquely identify which function to call based solely on the function signature. This ambiguity may result in unintended behavior or errors during function execution.
Proof of Concept
In foundry, use
``
Tools Used
Manual review and foundry
Recommended Mitigation Steps
To avoid ambiguity in function invocation, use distinct function names or parameter types for functions located in different contracts. Alternatively, consider varying the function's visibility or state mutability along with the parameter types to achieve function overloading if necessary.
Assessed type
Other