Skip to content

Conversation

@jp-bennett
Copy link
Collaborator

While triaging other issues, it became apparent that we accept invalid NodeInfo packets, regarding is_licensed. Closing that loophole

@jp-bennett jp-bennett requested a review from thebentern July 16, 2025 17:58
@thebentern thebentern requested a review from Copilot July 16, 2025 18:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a validation step to drop incoming NodeInfo packets when the is_licensed flag doesn’t match the local owner’s flag, preventing acceptance of invalid packets.

  • Introduce a guard in handleReceivedProtobuf to compare p.is_licensed with owner.is_licensed
  • Log a warning and return early to drop mismatched packets
Comments suppressed due to low confidence (1)

src/modules/NodeInfoModule.cpp:17

  • There should be unit or integration tests covering both matching and mismatching is_licensed scenarios to verify that packets are correctly accepted or dropped.
    if (p.is_licensed != owner.is_licensed) {

@thebentern thebentern merged commit c3b2b47 into master Jul 16, 2025
52 checks passed
@thebentern thebentern deleted the is_licensed-desync branch July 16, 2025 21:05
oscgonfer pushed a commit to fablabbcn/smartcitizen-meshtastic that referenced this pull request Jul 22, 2025
oscgonfer pushed a commit to fablabbcn/smartcitizen-meshtastic that referenced this pull request Jul 23, 2025
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.

2 participants