Skip to content

tailcat: reject null regions and nodes in a ConnBlob - #52

Merged
bradfitz merged 1 commit into
tailscale:mainfrom
CharmingGroot:fix-nil-connblob-region
Aug 31, 2026
Merged

tailcat: reject null regions and nodes in a ConnBlob#52
bradfitz merged 1 commit into
tailscale:mainfrom
CharmingGroot:fix-nil-connblob-region

Conversation

@CharmingGroot

Copy link
Copy Markdown
Contributor

Summary

Reject ConnBlobs whose region or node arrays contain a CBOR null, instead of panicking on the nil pointer. Fixes #51.

Details

CBOR nulls decode to nil pointers. ParseConnBlob dereferenced the elements of both arrays without checking, so a blob with a null in either one crashed the process at wire.go:94 or wire.go:100.

Blobs are attacker-influenced: addrBlobArg treats a non-tc argument as a DNS name and takes the tailcat= TXT value as the blob, so the owner of a DNS name could crash a client. Callers cannot defend against it — the two call sites in cmd/tailcat probe with ParseConnBlob and test err == nil, which a panic bypasses.

This is the same class as #26, which rejected malformed public keys for the same reason; that change validated the key lengths but left the array elements unchecked. The error wording follows it.

ParseConnBlobRaw is deliberately left permissive: tailcat parse is a diagnostic for inspecting a broken blob, so it keeps showing the nulls.

Testing

  • TestParseConnBlobNullInArrays is the regression test: it panics before the change and passes after it.
  • TestParseConnBlobRawKeepsNulls passes both before and after. It locks in the permissive raw path, so moving the validation earlier would fail visibly rather than silently changing what tailcat parse prints.
  • go test ./..., go vet ./..., gofmt clean.

CBOR nulls decode to nil pointers, so a blob whose region or node array
contained a null panicked when ParseConnBlob dereferenced it. Blobs come
from untrusted places — a pasted address, or a "tailcat=" TXT record
looked up from a DNS name — so that took down the process.

Reject them with an error instead. ParseConnBlobRaw keeps returning the
nulls: "tailcat parse" is a diagnostic for inspecting a broken blob.

Fixes tailscale#51

Signed-off-by: Ho Geun Choi <ohyes9711@gmail.com>
@bradfitz
bradfitz merged commit 2a48b15 into tailscale:main Aug 31, 2026
5 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.

ParseConnBlob panics on a ConnBlob whose region or node array contains a null

2 participants