This repository was archived by the owner on May 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
This repository was archived by the owner on May 26, 2023. It is now read-only.
csanuragjain - Incorrect owner check #263
Copy link
Copy link
Open
Labels
Escalation ResolvedThis issue's escalations have been approved/rejectedThis issue's escalations have been approved/rejectedRewardA payout will be made for this issueA payout will be made for this issueSpecificationAn issue related to the specification (low severity)An issue related to the specification (low severity)
Description
csanuragjain
low
Incorrect owner check
Summary
The depositTransaction of OptimismPortal can directly be called by user instead of intermediate contract. This means from address wont be aliased. But this is not considered in CrossDomainOwnable contract which plainly undoL1ToL2Alias the caller
Vulnerability Detail
- Assume
depositTransaction
is called by User A directly. Since no intermediary contract so no aliasing is done - On L2 side, if _checkOwner is checked
function _checkOwner() internal view override {
require(
owner() == AddressAliasHelper.undoL1ToL2Alias(msg.sender),
"CrossDomainOwnable: caller is not the owner"
);
}
- This will try undoL1ToL2Alias on User A address and then match with owner which is incorrect since User A address was never aliased on L1
Impact
The owner check might fail for genuine transaction
Code Snippet
Tool used
Manual Review
Recommendation
This check need to be revised. If the transaction came directly from tx.origin (without any intermediary contract) then no need of removing aliasing
Metadata
Metadata
Assignees
Labels
Escalation ResolvedThis issue's escalations have been approved/rejectedThis issue's escalations have been approved/rejectedRewardA payout will be made for this issueA payout will be made for this issueSpecificationAn issue related to the specification (low severity)An issue related to the specification (low severity)