From 747e8efe780cbcba03a5acfa8118565faa03262d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 29 Jul 2026 21:06:37 +0200 Subject: [PATCH 1/2] Verify signatures against authoritative keys only --- src/mesh/Router.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index cf0e05c9ae8..6648f6656cf 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -633,7 +633,9 @@ bool checkXeddsaReceivePolicy(meshtastic_MeshPacket *p) if (p->decoded.xeddsa_signature.size == XEDDSA_SIGNATURE_SIZE) { meshtastic_NodeInfoLite_public_key_t senderKey = {0, {0}}; meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(p->from); - if (nodeDB->copyPublicKey(p->from, senderKey)) { + // Authoritative keys only: verifying against an opportunistic cache key would let a planted + // key mark its own node a signer, the trust loop #11116 closed on the decrypt path. + if (nodeDB->copyPublicKeyAuthoritative(p->from, senderKey)) { p->xeddsa_signed = crypto->xeddsa_verify(senderKey.bytes, p->from, p->id, p->decoded.portnum, p->decoded.payload.bytes, p->decoded.payload.size, p->decoded.xeddsa_signature.bytes); From d96e823dbb962b184c03f15c06bef10f644e77fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 29 Jul 2026 21:07:16 +0200 Subject: [PATCH 2/2] Release the packet on the unset-variant send error --- src/mesh/Router.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 6648f6656cf..b1bd579d091 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -465,6 +465,8 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) if (!(p->which_payload_variant == meshtastic_MeshPacket_encrypted_tag || p->which_payload_variant == meshtastic_MeshPacket_decoded_tag)) { + // Error returns from here own the packet, as the position-precision path below does. + packetPool.release(p); return meshtastic_Routing_Error_BAD_REQUEST; }