Skip to content

fix: enforce MaxNameLength=253 on REGISTER (PILOT-275)#5

Open
matthew-pilot wants to merge 1 commit into
mainfrom
openclaw/pilot-275-20260530-021035
Open

fix: enforce MaxNameLength=253 on REGISTER (PILOT-275)#5
matthew-pilot wants to merge 1 commit into
mainfrom
openclaw/pilot-275-20260530-021035

Conversation

@matthew-pilot
Copy link
Copy Markdown
Collaborator

What

The nameserver RegisterN/RegisterA/RegisterS handlers accepted names of arbitrary length — a 64 KiB name stored in the in-memory map constituted a trivial memory-DoS vector.

Fix

Add MaxNameLength=253 (RFC 1035 maximum) and reject names exceeding it at handleRegister with an ERR name too long response.

Files changed:

  • records.go: +6 lines — MaxNameLength constant
  • server.go: +5 lines — boundary check in handleRegister
  • zz_coverage_test.go: updated characterization test → boundary + rejection tests

Verification

go build ./...   # ✅
go vet ./...     # ✅  
go test ./...    # ✅ (0.197s, all pass)

Closes PILOT-275

The RegisterN/RegisterA/RegisterS handlers accepted names of
arbitrary length — a 64 KiB name stored in the in-memory map
constituted a trivial memory-DoS vector (any registered peer
could send one REGISTER N line).

Add MaxNameLength=253 (RFC 1035 maximum) and reject names that
exceed it at the handleRegister gateway with an ERR response.
The store functions are left unchanged; the single boundary check
in handleRegister covers all three record types (A/N/S).

Closes PILOT-275
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew PR Status — #5

Title: fix: enforce MaxNameLength=253 on REGISTER (PILOT-275)
Status: OPEN | Mergeable: MERGEABLE
Author: @matthew-pilot (matthew-pilot bot)
Created: 2026-05-30T02:11:40Z
Branch: openclaw/pilot-275-20260530-021035main
Changes: +52/-11 across 3 files

Tickets

🔗 PILOT-275

Labels

None

Files Changed

  • records.go (+6)
  • server.go (+5)
  • zz_coverage_test.go (+41)

Next Actions

  • Explain: /pr explain #5 — detailed analysis
  • Canary retry: /pr retry-canary #5 (if CI failed)
  • Fix & update: /pr fix #5 <instructions>
  • Rebase: /pr rebase #5
  • Close: /pr close #5 <reason>

🦾 Auto-generated status check by matthew-pr-worker

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew PR Explain — #5

What this PR does

fix: enforce MaxNameLength=253 on REGISTER (PILOT-275)

Scope

  • Files: 3 files
  • Delta: +52/-11 lines
  • Labels: none
  • Mergeable: MERGEABLE

Tickets

🔗 PILOT-275

Files

  • records.go (+6/-0)
  • server.go (+5/-0)
  • zz_coverage_test.go (+41/-11)

Review Notes

  • This is an automated code-maintenance PR from matthew-pilot
  • Operator review required before merge
  • Check CI status and canary results above

🦾 Auto-generated explain by matthew-pr-worker

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew PR Check — #5 PILOT-275

Status

  • State: OPEN · MERGEABLE ✅
  • CI: 2/2 green (test ✅, codecov/patch ✅)
  • Files: 3 (+52/−11)
  • Branch: openclaw/pilot-275-20260530-021035
  • Canary: not-configured (nameserver)

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew Explains — #5 PILOT-275

What this does

Adds MaxNameLength=253 (RFC 1035 maximum) and rejects names exceeding it at the handleRegister gateway. The RegisterN/RegisterA/RegisterS handlers previously accepted names of arbitrary length — a 64 KiB name stored in the in-memory map was a trivial memory-DoS vector.

Files

  • records.go (+6): MaxNameLength constant
  • server.go (+5): boundary check in handleRegister
  • zz_coverage_test.go (+41/−11): characterization + boundary rejection tests

Risk

LOW — single boundary check in the register path; all three record types (A/N/S) covered by one gate. Tests pass. No wire-format change.

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