skills/vulnerability-patterns/authorization-txorigin/SKILL.md
Contract uses tx.origin for authorization or access control checks (e.g., require(tx.origin == owner))
npx skillsauth add apegurus/solidity-argus authorization-txoriginInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
tx.origin for authorization or access control checks (e.g., require(tx.origin == owner))contract Wallet {
address public owner;
function transferTo(address to, uint256 amount) external {
// tx.origin is the EOA that initiated the entire tx chain
// If owner calls MaliciousContract, which calls Wallet.transferTo,
// tx.origin is still the owner — check passes
require(tx.origin == owner, "not owner");
payable(to).transfer(amount);
}
}
contract Attacker {
Wallet wallet;
// Owner calls this (e.g., via a phishing link)
fallback() external {
// tx.origin == owner because owner initiated the tx
wallet.transferTo(address(this), address(wallet).balance);
}
}
tx.origin in the codebasetx.origin is used in a require, if, or comparison for authorization purposes, flag ittx.origin is compared against privileged addresses (owner, admin, etc.)tx.origin == msg.sender used to verify EOA status is a different pattern (see asserting-contract-from-code-size) — still flag it but for different reasons (breaks with account abstraction)tx.origin used only for logging or analytics, not for authorizationtx.origin used in combination with msg.sender checks where msg.sender is the primary authorization mechanismtx.origin with msg.sender for all authorization checksmsg.sender reflects the immediate caller, not the transaction originatorfunction transferTo(address to, uint256 amount) external {
require(msg.sender == owner, "not owner"); // Immediate caller check
payable(to).transfer(amount);
}
testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.