Skip to content

Prevent repeater from adding itself to flood path multiple times#1781

Open
andrewdefilippis wants to merge 1 commit intomeshcore-dev:devfrom
andrewdefilippis:mesh-defense
Open

Prevent repeater from adding itself to flood path multiple times#1781
andrewdefilippis wants to merge 1 commit intomeshcore-dev:devfrom
andrewdefilippis:mesh-defense

Conversation

@andrewdefilippis
Copy link
Copy Markdown

@andrewdefilippis andrewdefilippis commented Feb 21, 2026

Summary

  • When a repeater goes rogue, it can inject its own id into the path multiple times.
  • Before appending this node's hash to the path in routeRecvPacket(), check if the last 2 path entries already match — if so, drop the packet instead of retransmitting
  • Allows up to 2 consecutive identical hashes (legitimate collision) but blocks 3+ (loop indicator)

Test plan

  • Verify build compiles cleanly (confirmed with PlatformIO Heltec_v3_repeater)
  • Trace attack scenario: packet with path [... 20 20] arriving at repeater with hash 0x20 is correctly dropped
  • Verify normal forwarding: packet with path [... AB] at repeater 0x20 forwards as [... AB 20]
  • Verify single collision: packet with path [... 20] at repeater 0x20 forwards as [... 20 20]

🤖 Generated with Claude Code


Description updated by myself to clarify the underlying issue as a rogue repeater injecting itself into the path multiple times, nearly exhausting max path, and transmitting corrupted messages.

example:

05 16 56 AB 86 7E 75 20 20 20 20 20 20 20 20 20 75 07 24 BE 53 A5 2D 6B 7C 9E 06 CD 97 A3 AD C0 FC 68 41 AC

https://discord.com/channels/1343693475589263471/1391673743453192242/1474609553533440020

Drop flood packets where the last 2 path hashes already match this
node's hash, stopping repeaters from re-inserting themselves into
the path and causing traffic amplification loops.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andrewdefilippis
Copy link
Copy Markdown
Author

andrewdefilippis commented Feb 21, 2026

As a quick note, this change would be better aligned with 2-byte repeater ids to have a more protected mesh. It can also be improved by allowing all repeaters to detect 3+ consecutive ids (which should be highly unlikely), and drop the packet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant