fix(net): validate IPv6 lease jail-name charset like the v4 twin (1.1.20)#222
Merged
Conversation
….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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ip6AllocPure::parseLeaseLine6only rejected an empty name, while its IPv4 twin (IpAllocPure::parseLeaseLine→nameLooksValid) 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
parseLeaseLine6now applies the same charset rule via a file-localleaseNameLooksValid(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_testcase (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)…and confirms a clean name (
web-1.app_2 fd00::5) still round-trips.Verified via a standalone harness against the real
parseLeaseLine6→IP6 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-onlyclean onip6_alloc_pure.cpp.kyua) runs the real ATF case.Docs
CHANGELOG [1.1.20]+--versionbump +docs/trust-model.{md,uk.md}Applies-to → 1.1.20.https://claude.ai/code/session_01X6t6tzVypHye5bDGLxzmZK
Generated by Claude Code