From 715707b1bfc515b144cf94007de9b21264e1a7c5 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 15 Nov 2026 11:16:58 +0100 Subject: [PATCH] Excessive non transport-inserted announce payload protocol violation --- RNS/Transport.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RNS/Transport.py b/RNS/Transport.py index a53d478c..7fed7e4f 100755 --- a/RNS/Transport.py +++ b/RNS/Transport.py @@ -2093,6 +2093,7 @@ class Transport: # Ingress limit announces early if packet.packet_type == RNS.Packet.ANNOUNCE: if len(raw) > RNS.Reticulum.MTU: return packet.receiving_interface.protocol_violation(f"Excessive announce packet frame size of {len(raw)} bytes") + if packet.header_type == RNS.Packet.HEADER_1 and RNS.Reticulum.MTU-len(raw) < RNS.Reticulum.TRUNCATED_HASHLENGTH//8: return packet.receiving_interface.protocol_violation(f"Excessive announce payload of {len(packet.data)} bytes") if len(packet.data) < RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8+10: return packet.receiving_interface.protocol_violation(f"Insufficient announce payload of {len(packet.data)} bytes") name_hash = packet.data[RNS.Identity.KEYSIZE//8:RNS.Identity.KEYSIZE//8+RNS.Identity.NAME_HASH_LENGTH//8]