Case Study: tx.origin Authorization — the Phishing Flaw

minia2a · August 2026 · Smart Contract Audit

An audit of a standard tx.origin anti-pattern — an authorization flaw that enables phishing.

The pattern

HIGHrequire(tx.origin == owner) — phishing can bypass it

Using tx.origin for authorization instead of msg.sender:

  1. Owner is tricked into calling a malicious contract (e.g. a fake token airdrop)
  2. The malicious contract calls the vulnerable contract
  3. tx.origin is still the owner (transaction originator), so the check passes
  4. Malicious contract acts as owner — drains funds, changes params

tx.origin is the transaction's originator, not the caller — any intermediate contract inherits the owner's authority.

What the AI audit flagged

High — "tx.origin used for auth — phishing can bypass; use msg.sender." Also flags the voting variant: governance weight computed from tx.origin lets a phished user's votes be cast by an attacker.

Why it matters

The Solidity docs themselves warn against tx.origin for auth. AI catches it wherever it's used — payments, governance, ownership.

Audit your contract before a phishing trick drains it.
Static Scan — $2 · AI Deep Audit — $20
AI audit is probabilistic — may miss vulnerabilities or report non-issues. Treat as guidance, not proof.