In OptimismPortal.sol in the finalizeWithdrawalTransaction(() function tx.origin is used.
tx.origin is a global variable in Solidity which returns the address of the account that sent the transaction.
Impact
Using the variable could make a contract vulnerable if an authorized account calls into a malicious contract.
w42d3n
low
Use of tx.origin in OptimismPortal.sol
Summary
Vulnerability Detail
In OptimismPortal.sol in the finalizeWithdrawalTransaction(() function tx.origin is used. tx.origin is a global variable in Solidity which returns the address of the account that sent the transaction.
Impact
Using the variable could make a contract vulnerable if an authorized account calls into a malicious contract.
Code Snippet
https://github.com/ethereum-optimism/optimism/blob/3f4b3c328153a8aa03611158b6984d624b17c1d9/packages/contracts-bedrock/contracts/L1/OptimismPortal.sol#L341-L343
Tool used
Manual Review
Recommendation
Its recommended to use msg.sender instead
References
https://www.adrianhetman.com/unboxing-tx-origin/