using tx.origin in access control checks #209
Answered
by
marceontech
joanthecoder
asked this question in
General
|
Is using |
Answered by
marceontech
Jul 30, 2025
Replies: 1 comment
|
Yes, it's still considered a serious security risk. The correct approach is to use Best practice: never use |
0 replies
Answer selected by
joanthecoder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it's still considered a serious security risk.
Using
tx.originin access control is unsafe because any contract that your user interacts with can trigger your contract, meaning that malicious contracts could trick users into executing actions as if they were authorized.The correct approach is to use
msg.sender, which refers to the direct caller of the function, not the origin of the full transaction.Best practice: never use
tx.originfor authorization logic, this hasn't changed.