Skip to content

tailcat: reject malformed ConnBlob public keys - #26

Merged
bradfitz merged 1 commit into
tailscale:mainfrom
keyurbodar:fix/reject-malformed-connblobs
Aug 30, 2026
Merged

tailcat: reject malformed ConnBlob public keys#26
bradfitz merged 1 commit into
tailscale:mainfrom
keyurbodar:fix/reject-malformed-connblobs

Conversation

@keyurbodar

Copy link
Copy Markdown
Contributor

Summary

Reject malformed public keys embedded in connection blobs instead of panicking during CBOR decoding.

Details

NodePublic.UnmarshalBinary passed arbitrary CBOR byte strings directly to key.NodePublicFromRaw32, which panics unless the input is exactly 32 bytes.

Connection blobs can be supplied by users or discovered through DNS TXT records, so malformed input could terminate the CLI or a library process.

This change validates the byte-string length first and returns a descriptive error. Regression tests cover both short and oversized public keys through ParseConnBlob and ParseConnBlobRaw.

Testing

  • go test . -run TestParseConnBlobMalformedPublicKey -count=1
  • go test . -run TestConnBlob -count=1
  • go test . -count=1

@bradfitz bradfitz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bradfitz
bradfitz merged commit a34089b into tailscale:main Aug 30, 2026
1 of 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