p2p/rlpx: 2KB maximum size for handshake messages (#30029)

Co-authored-by: Felix Lange <fjl@twurst.com>
pull/30035/head
David Theodore 3 months ago committed by GitHub
parent 00675c5876
commit 27654d3022
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      p2p/rlpx/rlpx.go

@ -604,6 +604,11 @@ func (h *handshakeState) readMsg(msg interface{}, prv *ecdsa.PrivateKey, r io.Re
}
size := binary.BigEndian.Uint16(prefix)
// baseProtocolMaxMsgSize = 2 * 1024
if size > 2048 {
return nil, errors.New("message too big")
}
// Read the handshake packet.
packet, err := h.rbuf.read(r, int(size))
if err != nil {

Loading…
Cancel
Save