From f88c333c37f5b2a741138dcb8a6e826ff8c72c28 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Thu, 30 May 2024 09:54:31 -0600 Subject: [PATCH] MessageFromTxes: check l2message length We should never hit this, but since this is a static rule we should check it in encoding and not just decoding. --- execution/gethexec/executionengine.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/execution/gethexec/executionengine.go b/execution/gethexec/executionengine.go index 3ef894d402..e841a93529 100644 --- a/execution/gethexec/executionengine.go +++ b/execution/gethexec/executionengine.go @@ -234,6 +234,9 @@ func MessageFromTxes(header *arbostypes.L1IncomingMessageHeader, txes types.Tran l2Message = append(l2Message, txBytes...) } } + if len(l2Message) > arbostypes.MaxL2MessageSize { + return nil, errors.New("l2message too long") + } return &arbostypes.L1IncomingMessage{ Header: header, L2msg: l2Message,