J_4 onlyEOA modifier [high]
usgeeus opened this issue · 2 comments
usgeeus commented
Configuration
- Severity: high
- Confidence : high
Lines of Code
Description
onlyEOA modifier can be bypassed if an interacting smart contract has the code written inside its constructor.
reference
Recommendation
The recommended way to prevent this is to change the onlyEOA() modifier to use require(msg.sender == tx.origin, ".."). This ensures that only EOA address and not contract address, because tx.origin will always refer to the original sender of the transaction which must be an EOA.
require(msg.sender == tx.origin)
usgeeus commented
solved closing this issue