[Feature Request]: Generate node ID out of public key #5007
Replies: 3 comments 9 replies
-
Seems likely to cause more issues, we are pretty far down the path of using the BLE Mac, there is a way to reset this on all platforms if you really want to. |
Beta Was this translation helpful? Give feedback.
-
Thanks (again :) ) @GUVWAF for giving me more details. There's one important bit I think you're missing: one of the major advantages of my proposal is to allow a node to get a totally new identity, unrelated to the previous one. Thus:
You wouldn't keep them the same. That's the point.
This would not happen too. For other node operators it would be just as if a new node appeared on the mesh. They don't know whom it belongs to. And that's what is intended. There a plenty of reasons for a user wishing to get a new ID for his node. Examples:
With the introduction of PKI, this need became even more pressing, as now the node ID gets associated with a specific pubkey on everyone's node DB. With the current MAC-based forever fixed node ID, stuff like repurposing a node or giving it to a friend, which before the PKI could be just a matter of doing a factory reset and setting a new node name, now involves coordination with all the peers of your mesh. That's lots of effort for no gain, as you do not wish (in all these scenarios) the ever again "be the same". On the other hand, if you do wish the keep the previous ID, it will be just a matter of backing up your keys. Easy. Now, on the finer details:
Not only that. A new node is immediately recorded to the node DB and used for relaying messages. No barriers to join the mesh.
Ohhh… So there's no automatic way to prune the node DB? What happens when it becomes full? The node just stops accepting new peers? If so, that's quite an attack vector. It should be addressed anyway.
Indeed, it works for channels, as those use a PSK. But it stops working for direct communication. I tested it. I was giving a node (that I just used for tests) to a friend. I did a factory reset (without saving the PKI keys of course), and now all peers are no longer able to read the node's battery level and GPS coordinates (due to the ID-to-key mismatch). We are now forced to contact everyone in the mesh whom already runs the PKI-enabled version. It could have been much simpler if the factory reset also gave it a need ID: my friend would now have a fresh device that had no correlation with my previous usage.
Sure, but that attack will become harder to pull off. With a cryptographically bound ID, the attacker won't be able to spoof the ID, only the node name. The victim receiving that message will thus see 2 nodes online with the same name, but with different IDs. Right now, things are worse: the attacker can spoof the ID too! The victim will only see 1 node on his list.
To sum it up simply, the advantages of using an ID bound to the pubkey, instead of a fixed one based on the MAC address, are:
|
Beta Was this translation helpful? Give feedback.
-
Because with the new PKI infrastructure the node ID now got tied to the node's pubkey.
That no longer suffices. The old node still exists in everyones' node DB and is associated with the previous pubkey. Since, with the current code base, the new node re-uses the previous node ID you will get a key mismatch. Thus, if for instance, a new person wants to use this new node, he will have to reach all peers that he has in common with the previous owner and say "hey, please delete the node, it's now owned by a different person".
That's what factory resets do everywhere else, they delete the previous owner state. IMHO the node ID should be part of that state. Take a look at how it works for a smartphone. Anyway, the default can be to keep the node ID and cryptograhic keys.
Tracking comes in many different forms. Not only listening to the node's position updates. Since, as of now, the node ID can never change, it's easy to track a device accross the network. An attacker can know that you went from one region to another, or from one country to another. (With messages being relayed over MQTT the attacker may not even need to have physical nodes in all places). For some reason or another you may wish to not reveal you're using Meshtastic on another place. The easy solution would be to get a new node ID, but that's impossible now (without change the source code).
Indeed. I just re-tested it again and I was able to get the battery level and GPS coordinates. The only thing that did not work were direct messages (as expected). Sorry for the wrong info on this one, and thanks for poiting it out.
Even without sharing a channel key other nodes will nevertheless retransmit your messages, right? I.e. their resources (in this case power and connectivity) are offered to you with no barrier. That's permissionless in my view. |
Beta Was this translation helpful? Give feedback.
-
Platform
Cross-Platform
Description
I'd like to propose creating the node ID (aka node number) out of the public key, similar to how software like Tor and SSH handle it.
This would allow users to choose whether a factory reset node should appear as new or retain its old identity.
Currently, the node ID is generated from the MAC address, which leads to issues when a node is reset and a new public and private key pair is generated without warning.
This causes PKI mismatches and prevents functions like updating the position or getting a new node name.
By generating the node ID from the public key, users can choose to back up their private and public keys and restore them after a factory reset, allowing the device to retain its identity on the network.
If the keys are not restored, the device will appear as a new node.
This approach also solves a a privacy concern, as it allows users to appear as a new device on the network if they choose to.
It's essential to inform users about the importance of backing up their keys, as mentioned in Feature Request #272.
This should be done in a secure and user-friendly way, such as prompting the user to download or print a copy of their private keys.
Regarding the open points in Feature Request #272 Prepare for PKI & Config Updates:
Tying the node ID the public key, will minimize the risk of a user resetting their node.
The chance of a user accidentally messing up their public key is minimized.
This can be implemented by adding an option to "forget" a node, which would remove the node's public key and any associated data such as the node id from the local device.
Rejoining the network, with a different public key and the same node id, will not be possible.
This will be the same as deleting a node. If the user wants to keep the node, he will restore his keys.
Here's a possible implementation:
address.
This feature would improve the overall security, privacy, and user experience of the Meshtastic network. It addresses the issues mentioned in Feature Request #272 Prepare for PKI & Config Updates and #281 Prompt User to download PKI keys for backups, and provides a more robust and user-friendly PKI system.
Relevant issues
Beta Was this translation helpful? Give feedback.
All reactions