This repository has been archived by the owner on May 26, 2023. It is now read-only.
koxuan - onlyEOAEx modifier that ensures call is from EOA might not hold true in the future #21
Labels
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
koxuan
medium
onlyEOAEx modifier that ensures call is from EOA might not hold true in the future
Summary
modifier
onlyEOAEx
is used to ensure calls are only made from EOA. However, EIP 3074 suggests that usingonlyEOAEx
modifier to ensure calls are only from EOA might not hold true.Vulnerability Detail
For
onlyEOAEx
,tx.origin
is used to ensure that the caller is from an EOA and not a smart contract.However, according to EIP 3074,
This EIP introduces two EVM instructions AUTH and AUTHCALL. The first sets a context variable authorized based on an ECDSA signature. The second sends a call as the authorized account. This essentially delegates control of the externally owned account (EOA) to a smart contract.
Therefore, using tx.origin to ensure msg.sender is an EOA will not hold true in the event EIP 3074 goes through.
Impact
Using modifier
onlyEOAEx
to ensure calls are made only from EOA will not hold true in the event EIP 3074 goes through.Code Snippet
BlueBerryBank.sol#L54-L59
Tool used
Manual Review
Recommendation
Recommend using OpenZepellin's
isContract
function (https://docs.openzeppelin.com/contracts/2.x/api/utils#Address-isContract-address-). Note that there are edge cases like contract in constructor that can bypass this and hence caution is required when using this.The text was updated successfully, but these errors were encountered: