I have a few questions on the Short Address attack:
Is it possible to apply this attack on a function which does not take encoded byte-code as input and execute it, for example -
function func(bytes data)?If yes, doesn't this mean that one should verify
msg.data.lengthin every public or external function?If a function of mine verifies the value of
msg.sender(doesn't matter how, but let's assume that the function can determine whether or not I trust this sender) - am I still at any risk of a non-verified sender calling it with malicious data?
I have found several partially-related answers on this website (one of them to my own question), but I have not been able to decide how this attack should be handled with in my solidity code (off-chain code is not critical as far as I'm concerned):
The majority opinion seems to be that such protection should not be added on-chain.
In my 3 questions above, I am trying to determine whether or not I can feel safe with that.
Thank you very much!!!
UPDATE:
As I mentioned above (and to the reader who closed this question as duplicate by specifying a question which I have explicitly linked here):
I have found several partially-related answers on this website (one of them to my own question), but I have not been able to decide how this attack should be handled with in my solidity code (off-chain code is not critical as far as I'm concerned):
Moreover, I have linked here both answers to the question suggested as a duplicate of mine (1 and 2 above), one of which was given by this reader (who apparently didn't bother to read through).
So again - the question (not answered anywhere within the linked material) - should I handle this attack on-chain or off-chain?
Thanks again!