Skip to content

Reject unsafe peer identifiers in the trust store - #25

Merged
JaredP94 merged 1 commit into
mainfrom
fix/truststore-path-safety
Nov 2, 2026
Merged

JaredP94 merged 1 commit into
mainfrom
fix/truststore-path-safety

Conversation

@JaredP94

@JaredP94 JaredP94 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Description

The trusted-node store joined a peer's UUID straight into a file path. That UUID comes from the network — a pairing exchange or a roster entry another trusted member endorsed — so an identifier like ../identity could make a roster merge write outside trusted/, overwriting this node's identity.json.

Identifiers are now validated before any pin path is derived: empty, ./.., either platform's separators, Windows drive/stream syntax, NUL and reserved device names are refused, without touching disk or announcing a change. Load skips such files.

Ported from NVIDIA/Personal-AI-Router@c299135 (NVIDIA#159); tests adapted to this fork's layout.

Scope

services/nvpair-cluster-manager/truststore.go and README.

Validation

go test ./... in nvpair-cluster-manager. The five new tests fail with the check stubbed out and pass with it.

Risk

Low: real identifiers are v4 UUIDs. nvpair-cluster-manager 2.1.0 → 2.1.1.

Checklist

  • I have read the Contributing Guidelines.
  • Every commit is signed off (git commit -s), certifying the Developer Certificate of Origin.
  • New or existing tests cover the change.
  • Relevant documentation is updated.
  • I checked the diff, changed filenames, and commit messages for credentials, private data, internal URLs, internal issue identifiers, and generated artifacts.
  • I recorded the validation commands and results above.
  • I bumped any affected component in services/versions.json, and described user-visible changes above so they reach the release notes.

Part of the upstream issue/PR review. Each branch is independent off main; they all bump services/versions.json, so the second one merged will need a trivial conflict resolution there.

The trusted-node store joined a peer's UUID straight into a file path. The
UUID comes from the network — a pairing exchange or a roster entry another
trusted member endorsed — so a crafted identifier such as "../identity"
could make a roster merge write a pin outside trusted/, overwriting this
node's identity.json.

Validate identifiers before deriving pin paths: reject empty identifiers,
dot components, either platform's separators, Windows drive/stream syntax,
NUL bytes and native reserved names. Load skips such files; Pin and Remove
refuse them without touching disk or announcing a change.

Ported from NVIDIA/Personal-AI-Router@c299135 (NVIDIA#159). The tests are
adapted to this fork's test layout.

Co-authored-by: Kaylee Lubick <kjlubick@users.noreply.github.com>
Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
@JaredP94
JaredP94 force-pushed the fix/truststore-path-safety branch from 773efbf to 9d892e9 Compare November 2, 2026 18:36
@JaredP94
JaredP94 merged commit f276307 into main Nov 2, 2026
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.

1 participant