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: ipv6 address parsing allows extra 0 #57760

Closed
mpetrunic opened this issue Jan 12, 2023 · 6 comments
Closed

net: ipv6 address parsing allows extra 0 #57760

mpetrunic opened this issue Jan 12, 2023 · 6 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mpetrunic
Copy link
Contributor

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

go1.19.5 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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mpetrunic/.cache/go-build"
GOENV="/home/mpetrunic/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/mpetrunic/.gvm/pkgsets/go1.19.5/global/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/mpetrunic/.gvm/pkgsets/go1.19.5/global"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/mpetrunic/.gvm/gos/go1.19.5"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/mpetrunic/.gvm/gos/go1.19.5/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build708551667=/tmp/go-build -gno-record-gcc-switches"

What did you do?

When parsing ipv6 address that contains group with more than 4 zeroes, it says it's valid like: 0:0:0:0:000000:ffff:127.1.2.3

What did you expect to see?

I expected nil result.

What did you see instead?

Parsed IP address

@gopherbot
Copy link

Change https://go.dev/cl/461605 mentions this issue: net/ip: proper ipv6 address parsing

@seankhliao
Copy link
Member

according to rfc 4291 section 2.2
each segment is at most 4 characters.

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 12, 2023
@seankhliao seankhliao changed the title affected/package: net/ip ipv6 address parsing is invalid net: ipv6 address parsing is invalid Jan 12, 2023
@mpetrunic
Copy link
Contributor Author

according to rfc 4291 section 2.2 each segment is at most 4 characters.

Tnx, yeah, I forgot to link rf^^

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 12, 2023
@seankhliao
Copy link
Member

Is there some standard that says more zeros are a valid representation?

@mpetrunic
Copy link
Contributor Author

Is there some standard that says more zeros are a valid representation?

Don't think so since other languages are limiting to 4 characters:

@seankhliao seankhliao added NeedsFix The path to resolution is known, but the work has not been done. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jan 12, 2023
@seankhliao
Copy link
Member

cc @neild @ianlancetaylor

@seankhliao seankhliao changed the title net: ipv6 address parsing is invalid net: ipv6 address parsing allows extra 0 Jan 12, 2023
@seankhliao seankhliao added this to the Unplanned milestone Jan 20, 2023
@neild neild self-assigned this Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants