Skip to content

Harden discovery metadata handling - #55

Merged
vikranthreddimasu merged 3 commits into
masterfrom
harden-discovery-inputs
Aug 4, 2026
Merged

vikranthreddimasu merged 3 commits into
masterfrom
harden-discovery-inputs

Conversation

@vikranthreddimasu

@vikranthreddimasu vikranthreddimasu commented Aug 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Validate discovered peer GPU, RAM, score, and transport-port metadata before creating peer records.
  • Bound printable identity fields before retaining or displaying them.
  • Trim rich network-link advertisements to DNS TXT's 255-byte item limit so mDNS registration cannot fail.

Security changes

  • Reject negative, non-finite, oversized, and malformed untrusted mDNS metadata.
  • Reject control characters in terminal-visible peer identity and hardware fields.
  • No authentication, authorization, token, credential, TLS, or destructive-action behavior changed.

Usability changes

  • Prevent unusable peers with invalid control/data port combinations from entering discovery.
  • Preserve as much topology metadata as fits instead of failing node registration on large advertisements.
  • Keep v2.1 data-port fallback behavior when the derived port is valid.

Tests/checks run

  • python -m pytest tests/test_pool/test_discovery.py tests/test_pool/test_topology.py tests/test_security/test_fleet_discovery.py -q — 82 passed.
  • make lint — ruff clean; mypy success across 55 source files.
  • make test — 1104 passed, 3 skipped, 2 existing deprecation warnings.
  • python -m pip wheel . --no-deps — built macfleet-2.2.1-py3-none-any.whl.
  • git diff --check master...HEAD — clean.
  • Diff-file sensitive-pattern scan — no matches.

Commits

  • dda0573 Validate discovered peer metadata
  • f73f607 Bound discovery identity fields
  • e7b7c9b Keep discovery advertisements wire-safe

Risks / manual review notes

  • Low-risk discovery validation change; no credential or authentication paths changed.
  • Hardware limits are intentionally generous (1024 GPU cores, 65536 GB RAM) to reject corrupt metadata without constraining plausible future Macs.
  • Oversized topology advertisements retain the largest ordered subset that fits one TXT item.

Merge status

  • Merged into master after all 11 GitHub checks passed and the PR remained conflict-free.
  • Merge commit: 7b7611efea36271bd7d3bea4f11dba42660e4d94.

@vikranthreddimasu
vikranthreddimasu merged commit 7b7611e into master Aug 4, 2026
11 checks passed
@vikranthreddimasu
vikranthreddimasu deleted the harden-discovery-inputs branch August 4, 2026 07:34
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