Skip to content

Commit 888b6e1

Browse files
committed
Add note about arbitrary message sending from OptimismPortal
1 parent f37a108 commit 888b6e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

specs/withdrawals.md

+13
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ finalization.
4848
- [Security Considerations](#security-considerations)
4949
- [Key Properties of Withdrawal Verification](#key-properties-of-withdrawal-verification)
5050
- [Handling Successfully Verified Messages That Fail When Relayed](#handling-successfully-verified-messages-that-fail-when-relayed)
51+
- [OptimismPortal can send abitrary messages on L1](#optimismportal-can-send-abitrary-messages-on-l1)
5152

5253
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
5354

@@ -216,3 +217,15 @@ contracts if desired.
216217
217218
[`WithdrawalTransaction` type]: https://github.com/ethereum-optimism/optimism/blob/08daf8dbd38c9ffdbd18fc9a211c227606cdb0ad/packages/contracts-bedrock/src/libraries/Types.sol#L62-L69
218219
[`OutputRootProof` type]: https://github.com/ethereum-optimism/optimism/blob/08daf8dbd38c9ffdbd18fc9a211c227606cdb0ad/packages/contracts-bedrock/src/libraries/Types.sol#L25-L30
220+
221+
### OptimismPortal can send abitrary messages on L1
222+
223+
The `L2ToL1MessagePasser` contract's `initiateWithdrawal` function accepts a `_target` address and `_data` bytes,
224+
which is passed to a `CALL` opcode on L1 when `finalizeWithdrawalTransaction` is called after the challenge
225+
period. This means that, by design, the `OptimismPortal` contract can be used to send arbitrary transactions on
226+
the L1, with the `OptimismPortal` as the `msg.sender`.
227+
228+
This means users of the `OptimismPortal` contract should be careful what permissions they grant to the portal.
229+
For example, any ERC20 tokens mistakenly sent to the `OptimismPortal` contract are essentially lost, as they can
230+
be claimed by anybody that pre-approves transfers of this token out of the portal, using the L2 to initiate the
231+
approval and the L1 to prove and finalize the approval (after the challenge period).

0 commit comments

Comments
 (0)