[Bug]: Stop replying to frames with "Want_Response: true" sent to broadcast
Category
Other
Hardware
Not Applicable
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
- [ ] Meshtastic UI aka MUI colorTFT
- [ ] InkHUD ePaper
- [ ] OLED slide UI on any display
Firmware Version
any
Description
For some reason old firmware (at least 2.3.11) versions sometimes sends POSITION_APP / NODEINFO_APP / TELEMETRY_APP frames with "want_response: true" flag addressed to the broadcast (4294967295) with its configured hoplimit. It results an avalanche of responses within the network. In our environment (southern Poland, ShortFast, approx 500 nodes online) it completely kills the network for next ~15-20 seconds. It really behaves like a DDoS. As we can't easily get rid of this kind of ancient nodes from the network could you please consider to stop replying to the Lora frames with "want_response:1" addressed to ALL?
Relevant log output
Sample of the source packet I get from my MQTT broker:
"Import Time
8:57:48 AM - 10-29-2025
packet
from: 3663122040
to: 4294967295
channel: 112
decoded {
portnum: POSITION_APP
want_response: true
}
id: 827399159
rx_time: 1761724667
rx_snr: -8.75
hop_limit: 5
rx_rssi: -119
hop_start: 6
relay_node: 164
transport_mechanism: TRANSPORT_LORA
payload
map
latitude_i: 506605000
longitude_i: 194211000
altitude: 434
time: 1761724658
precision_bits: 32"
Sample frame: https://lorastats.pl/Packet/18012212
OK, I think I found what is the root cause of this. I just confirmed that those "old firmware (at least 2.3.11)" nodes in our environment have physical watchdogs clicking rst / usr buttons on the device while its LED stops blinking. This led me to another observation, most devices sends their location to the primary channel while their USR button is pressed twice. I glanced firmware code and in firmware/src/modules/SystemCommandsModule.cpp found this:
case INPUT_BROKER_SEND_PING: service->refreshLocalMeshNode(); if (service->trySendPosition(NODENUM_BROADCAST, true)) { IF_SCREEN(screen->showSimpleBanner("Position\nSent", 3000)); } else { IF_SCREEN(screen->showSimpleBanner("Node Info\nSent", 3000)); } return true;
Looks like the function responsible for sending "pings" while USR button is pressed twice has a flag wantreplies set to "true". Well, it seems, this is the reason why large networks sometimes experience such DDoS broadcast storms as every node in the mesh is trying to reply to this messages.
Conclusion:
- I think this could be easily fixed by changing WantReplies flag to false in trySendPosition call.
- To get rid of such incidents in the future would be also good to stop replying to messages with WantResponse flag when they are sent to the broadcast (4294967295). Replying for such is simply a bad idea.
It's not just old firmware, current firmware can generate these too.
https://github.com/meshtastic/firmware/blob/91621427f1d31ea2d8d0ebad78f05e405fb6c13a/src/modules/NodeInfoModule.cpp#L137-L148
or
https://github.com/meshtastic/firmware/blob/91621427f1d31ea2d8d0ebad78f05e405fb6c13a/src/modules/PositionModule.cpp#L330-L344
This is how the exchange position feature works in both apps.
The exchange position and exchange user info functions trigger sending your position/NodeInfo addressed to that node specifically and request a response from just that one node.
The broadcast after changing the radio settings however is directed at the broadcast address and requests a reply from EVERY node that can hear it.
This is how the exchange position feature works in both apps.
No, it isn't. Exchange position (and exchange nodeinfo, telemetry too) are sent to particular node (lets call it unicast) when reply is requested. There is no point to send position exchange to everyone and request reply from everyone. It's not critical in small environments, but gets really painful in large meshes with 500+ nodes.
I wouldn't say there is no point, in the current firmware it's meant as an initial discovery after joining a mesh (a mesh being the set of nodes with compatible radio settings) for the first time ever.
Without this, you might have to wait for many hours, maybe days to get a decent overview over who's there.
But you're right about broadcasts with want_reply = true being pretty much the worst case in respect to how much traffic it causes.
Unfortunately at this point the node doesn't know anything about how much nodes there are around it, so it's difficult for it to decide whether sending such a request is acceptable.
Since I'm currently working on load management in general, I'm open to suggestions how this could be made to behave nicer.
Thanks for bringing this up, I wasn't actually aware of this mechanism before.
Since I'm currently working on load management in general, I'm open to suggestions how this could be made to behave nicer.
Asking for all NodeInfos when a node joins the mesh seems reasonable. Increasing timeout in NodeInfoModule::allocReply from 5 minutes to at 1 hour (or even config.device.node_info_broadcast_secs) if request's destination was broadcast could be a good start.
Asking for position of all nodes is questionable. Perhaps such query could be limited to hopLimit = 0 or a node should accept such query only from favorite nodes.
Broadcast request for telemetry seems completely pointless. In edge cases of private/managed mesh of sensors when synchronized readings are required, perhaps SENSOR devices could respond to it, and even that should be further limited to favorite nodes.
Asking for all NodeInfos when a node joins the mesh seems reasonable. Increasing timeout in NodeInfoModule::allocReply from 5 minutes to at 1 hour (or even config.device.node_info_broadcast_secs) if request's destination was broadcast could be a good start.
Maybe, but we need to make sure this higher cooldown only applies to broadcast replies and doesn't break unicast NodeInfo requests/responses.
The broadcast request itself is already only triggered once after changing radio settings, so the cooldown period is technically infinite (unless you change radio settings again).
Asking for position of all nodes is questionable.
I agree somewhat, but it's probably the lesser issue, since only nodes that share their position in the first place will respond with a position. Everyone else will respond with its NodeInfo instead.
Broadcast request for telemetry seems completely pointless.
Mostly agree, but that doesn't happen in current firmware as far as I can see. All telemetry modules hardcode want_response=false
Broadcast request for telemetry seems completely pointless.
Mostly agree, but that doesn't happen in current firmware as far as I can see. All telemetry modules hardcode
want_response=false
Right, but still broadcasting a packet with want_response=true causes all other nodes to reply, which isn't ideal when such messages are fabricated on purpose.
I wouldn't say there is no point, in the current firmware it's meant as an initial discovery after joining a mesh (a mesh being the set of nodes with compatible radio settings) for the first time ever.
Without this, you might have to wait for many hours, maybe days to get a decent overview over who's there.
Well, I understand the purpose. It makes sense. But in real world there are many devices rebooting itself couple of times a day. As both firmware and hardware platforms were pretty unstable in the past there are many both software and hardware "watchdog" devices restarting nodes in case of their unresponsiveness (like this: https://meshtastic.pop.pl/viewtopic.php?t=11 - sorry for Polish language, please google translate it if you want). In results, if we have 6 boards restating itself 3 times a day, each one causing reply of 50+ nodes* we experience really heavy, completely unnecessary traffic, of ~1000 frames completely freezing Lora for couple of seconds in ShortFast and dozens in longer-transmiting presets.
*) actually it's not a case of 50+ replies, we only see 50+ replies as all of the nodes transmit their replies in the same time causing collisions; I'm afraid ALL 500+ nodes within the network are replying for that request, we simply can't hear them because of collisions.
I see, I think I partially missed your point.
I don't think rebooting should trigger this, but it seems it does.
I see, I think I partially missed your point.
I don't think rebooting should trigger this, but it seems it does.
Frankly speaking I couldn't replicate this behaviour on any newer firmwares, maybe except the moment where I push USR button twice which is also sending PositionInfo frame with WantResponse=1. PositionInfo on boot happens mostly on 2.4 / 2.5 firmwares as far as I can see. That's why I didn't ask to fix the root cause (actually wantresponse=1 on USR button should be fixed, but this is different story), I asked to consider to stop replying to all frames with wantresponse=1 and destination to broadcast, because it generates classic DDoS in the network.
So far, I have not noticed any attempts to offensively exploit this vulnerability, but I do not see any reasons why an attacker would not be able to shutdown the entire Meshtastic network by sending NodeInfo / PositionInfo alternately with the WantReposne=1 flag every minute or even second.
I do not see any reasons why an attacker would not be able to shutdown the entire Meshtastic network by sending NodeInfo / PositionInfo alternately with the WantReposne=1 flag every minute or even second.
Well, each individual node still has a cooldown period and can't respond to those requests arbitrarily often.
Otherwise, there's not much in place to stop a malicious actor from bringing down a mesh currently, yes.
I have a rough draft for improving resilience here, but it's far from finished and depends on a moonshot that's also far from finished.
There's only so much you can do anyways, RF links with low Tx power and high Rx sensitivity are naturally easy to jam even without deep understanding of the protocol like what we are discussing here.
Well, each individual node still has a cooldown period and can't respond to those requests arbitrarily often.
That's true, but such amplification gives attacker a tool to flood the network with even when he is legally using 869MHz under 10% duty cycle. Actually none of attacked nodes would break duty cycle here.
This issue has not had any comment or update in the last month. If it is still relevant, please post update comments. If no comments are made, this issue will be closed automagically in 7 days.
Well, it is very relevant I would say
It still is!
still very relevant!
agreed, very relevant. On any duty-cycle-restricted, large mesh, this needs to stop. To be fair, Meshtastic was never intended at first for the large, dense networks we use them for today, as e.g. in Switzerland on MEDIUM_FAST with over 600 nodes or in Italy with more than 600 nodes as well. Yes, we may switch to an even shorter preset like SHORT_SLOW, but the main issue remains, regardless of presets.
@h3lix1 @thebentern @korbinianbauer @NomDeTom
It'd be great to approach this from the "react to" angle, as is proposed here, in addition to the "filter" angle, as is the idea with upcoming Traffic Management module https://github.com/meshtastic/firmware/pull/9358 https://github.com/meshtastic/firmware/pull/9921
Related issue comment at https://github.com/meshtastic/firmware/issues/8924#issuecomment-5352272365
Without this, you might have to wait for many hours, maybe days to get a decent overview over who's there.
Is it really necessary at node start or reboot to ask the whole mesh to reply to me with NodeInfos right away? I don't know, I would not mind waiting 24 hours to see what is popping up at regular, configured intervals of the other nodes on the mesh. Making that behavior at least configurable with a flag / boolean would help.