-
Notifications
You must be signed in to change notification settings - Fork 18k
net: limit the size of ParseIP input? #43389
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
Comments
On Linux, see constant |
Previously: #30999 ("proposal: net/url: reject leading zeros in IP address parsers") |
Change https://golang.org/cl/325829 mentions this issue: |
Hello. I know the discussion about this has been primarily centered on how to best deliver it to Go v1.17, but my team is still reliant on Go v1.15, the amd64 build, which is still in the support stream according to https://golang.org/doc/go1.15. Specifically:
To clarify, we are using Linux amd 64bit, not Mac, not Windows. We see patches continue to be released on the Go 1.15 stream, for which we are very grateful to the community. This issue, btw, corresponds to CVE-2021-29923. We would very much appreciate its resolution on the Go v1.15 branch; and will happily move to Go v1.15.16 if it contains this fix. There's another issue #30999, which seems to be related closely in that it's in the same CVE (29923) and also relates to IP addresses. Can we address them both for Go v1.15.16? Please? |
@benjsmi As of the Go 1.17 release, Go 1.15.x is no longer supported for any further releases as per our maintenance policy. Please upgrade to the latest supported version of Go. |
@benjsmi Go 1.15 is no longer supported since 1.17 was released:
https://github.com/golang/go/wiki/MinorReleases So security fixes in minor releases at the moment are limited to 1.16 and 1.17. In general, you should not expect 1.15 to have further minor releases. |
Thanks for the responses everyone. This is an unfortunate situation but I completely understand why you're handling it this way. |
So I'm not seeing this issue specifically mentioned in the Go 1.16 release notes -- is CVE-2021-29923 addressed in Go 1.16.x? And if so, which x? |
The |
Hey, Thanks |
With the release of 1.18, 1.16 is no longer supported. |
Maybe net.ParseIP shouldn't successfully parse IP addresses out of unbounded inputs?
e.g.
fmt.Println(net.ParseIP(strings.Repeat("0", 10<<20) + "000000192.0000168.00000.00001"))
passes, as does UnmarshalText (https://play.golang.org/p/bXGEzOS6KVQ)Of course, in both those cases the data is already fully in memory, so most the harm has been done if this is attacker-controlled.
Still, a bit surprising. Intentional?
Some parsers reject past 3 digits per octet, so
196.168.020.001
is valid, but not0196.0168.0020.0001
.The text was updated successfully, but these errors were encountered: