Skip to content

fix(net): validate IPv6 lease jail-name charset like the v4 twin (1.1.20)#222

Merged
click0 merged 1 commit into
mainfrom
claude/analyze-test-coverage-nCOJW
Jul 5, 2026
Merged

fix(net): validate IPv6 lease jail-name charset like the v4 twin (1.1.20)#222
click0 merged 1 commit into
mainfrom
claude/analyze-test-coverage-nCOJW

Conversation

@click0

@click0 click0 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Ip6AllocPure::parseLeaseLine6 only rejected an empty name, while its IPv4 twin (IpAllocPure::parseLeaseLinenameLooksValid) restricts the jail name to [A-Za-z0-9._-], 1–64 chars.

A hand-edited or corrupt IPv6 lease line whose name held control characters, embedded whitespace, or .. / / path-traversal parsed as valid on the v6 path and flowed downstream — an asymmetry the project-wide pure-module audit flagged (the v4 path already rejected these).

Fix

parseLeaseLine6 now applies the same charset rule via a file-local leaseNameLooksValid (mirroring the v4 check, kept local rather than exported so the two lease modules stay decoupled) and also rejects trailing whitespace in the address, matching v4.

Tests

New ip6_alloc_pure_test case (lease_parse_rejects_bad_name) rejects:

  • ../../etc fd00::5 (traversal)
  • a/b fd00::5 (slash)
  • na$me fd00::5 (shell meta)
  • na\tme fd00::5 (tab in name)
  • 65-char name (over the 64 limit)

…and confirms a clean name (web-1.app_2 fd00::5) still round-trips.

Verified via a standalone harness against the real parseLeaseLine6IP6 LEASE NAME CHECKS PASSED (kyua/atf are absent in this re-provisioned env); the ATF test file was shim-syntax-checked.

Test plan

  • g++ -fsyntax-only clean on ip6_alloc_pure.cpp.
  • Standalone harness: all bad-name forms rejected, clean name round-trips.
  • Test file parses clean.
  • Linux unit CI (kyua) runs the real ATF case.

Docs

CHANGELOG [1.1.20] + --version bump + docs/trust-model.{md,uk.md} Applies-to → 1.1.20.

https://claude.ai/code/session_01X6t6tzVypHye5bDGLxzmZK


Generated by Claude Code

….20)

Ip6AllocPure::parseLeaseLine6 only rejected an empty name; the IPv4
twin (IpAllocPure::parseLeaseLine -> nameLooksValid) restricts the name
to [A-Za-z0-9._-], 1..64 chars. A hand-edited or corrupt IPv6 lease
line whose name held control chars, embedded whitespace, or `..`/`/`
path-traversal parsed as VALID on the v6 path and flowed downstream —
an asymmetry the project-wide pure-module audit flagged.

parseLeaseLine6 now applies the same charset rule (a local
leaseNameLooksValid mirroring the v4 check, kept file-local rather than
exported so the two lease modules stay decoupled) and rejects trailing
whitespace in the address.

Tests: new ip6_alloc_pure_test case rejects traversal/slash/shell-meta/
tab/oversized names and confirms a clean name round-trips. Verified via
a standalone harness (kyua/atf absent in this env); test file
shim-syntax-checked. CHANGELOG [1.1.20] + --version + trust-model
Applies-to bump.

https://claude.ai/code/session_01X6t6tzVypHye5bDGLxzmZK
@click0 click0 merged commit 111c660 into main Jul 5, 2026
2 checks passed
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.

2 participants