Function selector collision is a situation where two functions have the same function selector. In this situation where user set's up a falback handler for a one function an attacker could trigger it if he found the function with the same selector.
Fallback handler is set up to handle the certain functions. It is set up based on msg.sig
. However there is a scenario where two functions have the same function selector. It will lead to triggering the fallback handler code for the wrong function which can lead to unexpected results.
There is an example of two different functions with the same function selector (0x42966c68
).
If the inputs of these functions were ignored and action was based on triggering the function an attacker could use different function to trigger fallback handler code.
Function handler code can be executed for the wrong function. Depending on function handler implementation this can affect account security or lead to an exploit.
To solve this problem the protocol could create a whitelist with addresses that can trigger the fallback handler. This will reduce the likelihood of an exploit with function selector.
This is a very clever exploit, however, would be dependent on - The user installing the malicious fallback handler. - Additionally, it is highly contraint because it would require the input parameters (`to` and `amount`) of `withdrawDepositTo()` that is also considered when determining the function signature to coincide with the same input parameters of the malicious functionality of the fallback handler Issues #185 and #190 are pointing to similar function clashing root causes so duplicating, but does lack a similar detailed explanation of exploit path.
This is a very clever exploit, however, would be dependent on - The user installing the malicious fallback handler. - Additionally, it is highly contraint because it would require the input parameters (`to` and `amount`) of `withdrawDepositTo()` that is also considered when determining the function signature to coincide with the same input parameters of the malicious functionality of the fallback handler Issues #185 and #190 are pointing to similar function clashing root causes so duplicating, but does lack a similar detailed explanation of exploit path.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.