Skip to content

fix(start-wrt): count a DNS publishing request only from a proven source - #4657

Merged
dr-bonez merged 1 commit into
masterfrom
wrt/dns-hint-proven-source
Nov 11, 2026
Merged

dr-bonez merged 1 commit into
masterfrom
wrt/dns-hint-proven-source

Conversation

@Dominion5254

@Dominion5254 Dominion5254 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

The device page's "trying to publish DNS records" note (#4608) counted any update refused for lacking the permission, including unsigned UDP. A UDP source address is not proven and the router does no reverse-path filtering, so a device in one profile could forge an update from a device in another and raise the note there, prompting the admin to grant a permission that device never asked for.

  • The transport check now precedes the permission check: an unsigned UDP update is refused as needing TCP and never counts as asking. An unsigned update over TCP, which StartOS sends, still counts.
  • Inbound VPN peers sign their updates and send them over UDP. Only permitted peers' TSIG keys were loaded, so an unpermitted peer's signature could not be verified and, after the reorder, its request would no longer surface. Every inbound VPN peer's key is now loaded for verification; the directory of who may publish still holds only permitted peers.

No changelog fragment: this refines the #4608 note, which has not been released.

Verification

On f6185a93e (before the rebase):

  • make start-wrt-test: startwrt-core 875 passed, uciedit 30 passed, 0 failed.
  • K1 bench router, master first: an update forged over UDP from a device on another profile's VLAN raised the note on the victim device. With the fix: forged and unsigned UDP updates no longer raise it, an unsigned TCP update does, and a permitted device publishing over TCP still publishes.
  • Not exercised on the bench: an inbound VPN peer's signed update (covered by unit tests only).

Rebased onto master 0b69dc3 (#4656) without conflicts; the master commits taken in change no start-wrt or start-core code. On 25e5b22: make start-wrt-format-check clean.

This and #4658 (port-forward request note) both edit dns_inject.rs. They merge without conflicts in either order, and make start-wrt-test passes on a local merge of both heads (startwrt-core 878, uciedit 30, 0 failed).

The device page's "trying to publish DNS records" note came from any
update refused for lacking the permission, including unsigned UDP. A UDP
source address is not proven and the router does no reverse-path
filtering, so a device in one profile could forge an update from a
device in another and raise the note there, prompting the admin to grant
a permission that device never asked for.

The transport check now precedes the permission check: an unsigned UDP
update is refused as needing TCP and never counts as asking. An unsigned
update over TCP, which StartOS sends, still counts.

Inbound VPN peers sign their updates and send them over UDP. Only
permitted peers' TSIG keys were loaded, so an unpermitted peer's
signature could not be verified and, with the reorder, its request would
no longer surface. Every peer's key is now loaded for verification; the
directory of who may publish still holds only permitted peers.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved at 25e5b22d1c3d1d04a650905967029a3dd7aaa0b3; no correctness findings. git merge-tree --write-tree origin/master HEAD succeeds, and GitHub reports MERGEABLE.

Unsigned UDP updates can no longer raise the device page’s DNS-publishing request note using a forged source address. An unsigned TCP request still counts, as does a correctly signed UDP request from an inbound VPN peer without publishing permission. The source-proof requirement is recorded beside the production policy gate.

The change reuses the shared injector’s existing TCP/TSIG evidence and refusal tracking. Loading every configured inbound peer’s derived verification key does not grant publishing permission: admission and ownership sweeping still use the permitted-peer directory. The additional map is an in-memory snapshot rebuilt by the existing refresher; there is no persisted configuration, API schema, or migration change. The existing unreleased Activity-log fragment still describes the feature accurately.

Implementation diff: +19 / −13 lines in 1 file (excludes lockfiles, tests, docs, release notes, and changelog).

Verification evidence is author-reported: the pre-rebase suite passed 875 startwrt-core and 30 uciedit tests; K1 bench checks reproduced the forged-UDP hint on master and confirmed its removal, retained TCP hints, and permitted TCP publishing with the fix. Inbound VPN behavior was covered by unit tests, not the bench. The reviewed head has a clean recorded formatting check; the author also reports passing tests on a local merge with #4658. I inspected the regressions, shared TSIG verification, transport callers, device-status consumers, and revocation sweep without running builds or tests. Current CI has passed Prettier and conflict checks; the riscv64 build, automated tests, formatting/lockfiles, generated artifacts, dependency licenses, and changelog/version checks remain pending.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@dr-bonez
dr-bonez merged commit bee51e1 into master Nov 11, 2026
21 checks passed
@dr-bonez
dr-bonez deleted the wrt/dns-hint-proven-source branch November 11, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants