Submitted by Bauchibred, also found by minglei-wang-3570, ulas, and RadiantLabs
Kakarot inherits the address aliasing logic from Optimism as hinted in AddressAliasHelper.sol:
Now this is a key property of the Optimism bridge, which is that all contract addresses are aliased. This is done in order to avoid a contract on L1 to be able to send messages as the same address on L2, because often these contracts will have different owners.
To go into more details about why & how this is used, please review here.
Thats to say we expect this aliasing logic to:
However, the issue is that Kakarot applies this aliasing logic not only on contracts but even EOAs, see here:
Evidently, the classic contract check of msg.sender != tx.origin is missing which means even when the caller is an EOA its still get aliased.
Broken functionality for aliasing senders considering even EOAs get aliased instead of it just being restricted to smart contracts; i.e., if developers implement access control checks on the sender of the transactions, say a deposit tx for e., they would have to believe that the address of the contract from the L1 is not aliased when it is an EOA. However, in Kakarots case, it is. Therefore, it would result in unintentional bugs where the access control will be implemented incorrectly and these transactions will always fail.
Apply an if msg.sender != tx.origin check instead and in the case where this ends up being true then alias the address otherwise let it be.
Context
ClementWalter (Kakarot) confirmed and commented:
LSDan (judge) commented:
obatirou (Kakarot) commented:
LSDan (judge) commented:
Kakarot mitigated:
Status: Mitigation confirmed.
