tx.origin
detector#
Name: tx-origin
Phishing attacks#
Access controls based on tx.origin
are vulnerable to phishing attacks. The
attacker may convince the user to send a transaction to an attacker's contract.
The attacker's contract may then call the victim's contract with tx.origin
set
to the victim's address.
Example#
- An attacker may convince
owner
to send a transaction to the attacker's contract.tx.origin
will be set toowner
. Attacker's contract callswithdraw
on the victim's contract, withdrawing the victim's funds.
Account abstraction#
Use of tx.origin
may prevent users using ERC-4337 account abstraction from interacting with a contract.
In this case, tx.origin
will not be set to the address of the user operation sender.
Example#
- Users using account abstraction will not be able to deposit funds into the contract.
Parameters#
Command-line name | TOML name | Type | Default value | Description |
---|---|---|---|---|
--account-abstraction/ --no-account-abstraction |
account_abstraction |
bool |
true |
Report ERC-4337 account abstraction related issues. |