fix: enforce MaxNameLength=253 on REGISTER (PILOT-275)#5
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🦾 Matthew PR Status — #5Title: fix: enforce MaxNameLength=253 on REGISTER (PILOT-275) TicketsLabelsNone Files Changed
Next Actions
🦾 Auto-generated status check by matthew-pr-worker |
🦾 Matthew PR Explain — #5What this PR doesfix: enforce MaxNameLength=253 on REGISTER (PILOT-275) Scope
TicketsFiles
Review Notes
🦾 Auto-generated explain by matthew-pr-worker |
🦾 Matthew PR Check — #5 PILOT-275Status
|
🦾 Matthew Explains — #5 PILOT-275What this doesAdds Files
RiskLOW — single boundary check in the register path; all three record types (A/N/S) covered by one gate. Tests pass. No wire-format change. |
What
The nameserver
RegisterN/RegisterA/RegisterShandlers 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 athandleRegisterwith anERR name too longresponse.Files changed:
records.go: +6 lines —MaxNameLengthconstantserver.go: +5 lines — boundary check inhandleRegisterzz_coverage_test.go: updated characterization test → boundary + rejection testsVerification
Closes PILOT-275