Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: Resolver CNAME size limit #51652

Closed
vpereira opened this issue Mar 14, 2022 · 2 comments
Closed

net: Resolver CNAME size limit #51652

vpereira opened this issue Mar 14, 2022 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@vpereira
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.16 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

Linux/amd64 but reproducible as well on go Playground

What did you do?

Adding a CNAME bigger than 63 bytes make methods like LookupCNAME fail without even calling the custom dial method. With 63 bytes, the custom dial method get called without problem.

PoC: https://go.dev/play/p/Y9tCeJjcuUI

What did you expect to see?

As described in the RFC upto 255 chars should be considered valid.

What did you see instead?

The method LookupCNAME fails with CNAMES with more than 63 bytes

@mengzhuo mengzhuo changed the title affected/package: net Resolver CNAME size limit net: Resolver CNAME size limit Mar 14, 2022
@mengzhuo mengzhuo added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 14, 2022
@mengzhuo
Copy link
Contributor

cc @neild

@seankhliao
Copy link
Member

DNS requires labels (the parts separated by dots) to be 63 bytes or less. It's the total length that can be up to 255 bytes.

Ref RFC 1034 Section 3.1

@golang golang locked and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants