From c8d75947f8cc1e12babd9a70487b64ac16aa5339 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Wed, 18 Nov 2026 10:31:04 +0100 Subject: [PATCH] README, docs: the replay floor that survives a reboot (1171d8f9) -- core fix, ACL_TS_MAX_AHEAD, upstream candidate Co-Authored-By: Claude Opus 5.5 --- README.md | 16 ++++++++++++++++ docs/tth-commands.md | 1 + 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index af2b4ad9..8a1163cc 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,14 @@ Repeater navíc: ### Opravy jádra +* **Ochrana proti přehrání admin příkazů přežije reboot.** Upstream si + poslední timestamp klienta drží jen v RAM, takže po každém restartu projde + libovolný zachycený příkaz znovu – zachycený `reboot` uzel restartuje + pořád dokola. Repeater, room server i sensor ho teď zapíšou do flash dřív, + než příkaz provedou (`/s_acl_ts0|1`, střídavě s kontrolním součtem, takže + ho nesmaže ani výpadek napájení při zápisu). Timestamp víc než den před + hodinami uzlu (`ACL_TS_MAX_AHEAD`) se přijme, ale neuloží, aby companion + s rozhozenými hodinami nezamkl admina. Klientů se to nijak netýká. * TRACE už nepřipisuje cestu za konec payloadu; parsování TRACE/PATH a `Packet::readFrom` hlídají meze. * `markSeen` je zase idempotentní (odesílací cesta ujídala okno deduplikace). @@ -395,6 +403,14 @@ The repeater also has: ### Core fixes +* **Replay protection of admin commands survives a reboot.** Upstream keeps a + client's last timestamp in RAM only, so after every restart any captured + command is accepted again -- a captured `reboot` reboots the node forever. + Repeater, room server and sensor now write it to flash before acting on the + command (`/s_acl_ts0|1`, alternating with a checksum, so a power cut mid-write + does not lose it). A timestamp more than a day ahead of the node's clock + (`ACL_TS_MAX_AHEAD`) is accepted but not stored, so a companion with a runaway + clock cannot lock its admin out. Nothing changes for clients. * TRACE no longer appends its path past the end of the payload; TRACE/PATH parsing and `Packet::readFrom` are bounds-checked. * `markSeen` is idempotent again (the send path was eating the dedup window). diff --git a/docs/tth-commands.md b/docs/tth-commands.md index e5815e03..70f8b0b0 100644 --- a/docs/tth-commands.md +++ b/docs/tth-commands.md @@ -188,6 +188,7 @@ The ones that change what a node does; set in `platformio.ini` / | `RADIO_DIAG`, `PIN_DIAG`, `LORA_POLL_IRQ` | unset | radio diagnostics, DIO1-less operation | | `FW_OTA` | `-ota` images | admin-pushed firmware update | | `PATH_HASH_MODE_DEFAULT` | `1` (2 B per hop) | path hash width for a node without prefs | +| `ACL_TS_MAX_AHEAD` | `86400` (s) | a client timestamp further ahead of the node's clock is not stored as the replay floor | Prefs saved on the node override the build defaults: a reflash keeps what a node already has; only a new node or one after `erase` takes them.