Use of tx.origin
for authorization may be abused by a MITM malicious contract forwarding calls from the legitimate user who interacts with it. Use msg.sender
instead. (see here)
- Use of
tx.origin
Dangerous tx.origin
-> EOA- Authorization MITM Replay Attack
tx.origin
->msg.sender