Skip to content

Crafting of specific NodeInfo packets overwrite any publicKey saved in the NodeDB

Critical
thebentern published GHSA-95pq-gj5v-4fg2 Aug 16, 2025

Package

No package listed

Affected versions

< v2.6.3

Patched versions

v2.6.3

Description

An attacker can send NodeInfo with a empty publicKey first, then overwrite with a new key.

firmware/src/mesh/NodeDB.cpp

Lines 1438 to 1447 in 1e4a013

if (p.public_key.size > 0) {
printBytes("Incoming Pubkey: ", p.public_key.bytes, 32);
if (info->user.public_key.size > 0) { // if we have a key for this user already, don't overwrite with a new one
LOG_INFO("Public Key set for node, not updating!");
// we copy the key into the incoming packet, to prevent overwrite
memcpy(p.public_key.bytes, info->user.public_key.bytes, 32);
} else {
LOG_INFO("Update Node Pubkey!");
}
}

First sending a empty key bypasses if (p.public_key.size > 0) {, clearing the existing publicKey (and resetting the size to 0) for a known node.

Then a new key bypasses if (info->user.public_key.size > 0) {, and this mallicious key is stored in NodeDB.

auto lite = TypeConversions::ConvertToUserLite(p);

memcpy(lite.public_key.bytes, user.public_key.bytes, sizeof(lite.public_key.bytes));
lite.public_key.size = user.public_key.size;

I tested my commit with a few nodes and this seems to succesfully prevent the exploit.


Report above as shared by @dfsx1 in #6372. I've added it here so that the Security Advisories tab reflects this issue and the version of the firmware that were patched. Also, by getting a CVE, there is a way to keep track and reference this specific vulnerability.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L

CVE ID

CVE-2025-55293

Weaknesses

No CWEs

Credits