Merge upstream/dev (1 commit: sec patch) [upstream-sync]
Changelog: Repeater, room server, sensor: an admin's CLI reply captured over the air can no longer be sent back to the node as a command (upstream security fix) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
22700192bd
15 files changed
+151
-12
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <Utils.h>
|
||||
#include <helpers/UTF8Helpers.h>
|
||||
|
||||
#ifndef SERVER_RESPONSE_DELAY
|
||||
#define SERVER_RESPONSE_DELAY 300
|
||||
@@ -247,7 +248,10 @@ void BaseChatMesh::onPeerDataRecv(mesh::Packet* packet, uint8_t type, int sender
|
||||
// len can be > original length, but 'text' will be padded with zeroes
|
||||
data[len] = 0; // need to make a C string again, with null terminator
|
||||
|
||||
if (flags == TXT_TYPE_PLAIN) {
|
||||
size_t text_ofs = (flags == TXT_TYPE_SIGNED_PLAIN) ? 9 : 5; // signed text starts after 4-byte sender prefix
|
||||
if (len < text_ofs || !mesh::isValidUtf8TextAndPadding(&data[text_ofs], len - text_ofs)) {
|
||||
MESH_DEBUG_PRINTLN("onPeerDataRecv: invalid text payload!");
|
||||
} else if (flags == TXT_TYPE_PLAIN) {
|
||||
from.lastmod = getRTCClock()->getCurrentTime(); // update last heard time
|
||||
onMessageRecv(from, packet, sender_timestamp, (const char *) &data[5]); // let UI know
|
||||
|
||||
|
||||
Reference in new issue
Block a user