x/net/publicsuffix: EffectiveTLDPlusOne accepts IP Addresses #32979
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
By passing an IP address into this function, I am provided the last index of the Network ID, and the Host ID (3rd & 4th position).
What did you expect to see?
An error stating that what was provided was...
or
What did you see instead?
Validation should occur to ensure that what is being passed matches the named parameter,
domain
.Validation is already present: https://github.com/golang/net/blame/da137c7871d730100384dbcf36e6f8fa493aef5b/publicsuffix/list.go#L168
To argue that this function should not be responsible for checking if this is a valid domain name would be counterintuitive to L168 linked above.
If this is not the responsibility of this function to ensure what is being passed is actually a domain, then I propose changing the function name to something more similar of what it does.. perhaps
AlphasBetweenLastTwoPeriodsInString
🙄The text was updated successfully, but these errors were encountered: