-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
math/big: (*Rat).SetString with "1.770p02041010010011001001" crashes with "makeslice: len out of range" #45910
Comments
Change https://golang.org/cl/316149 mentions this issue: |
Should we perhaps backport this change? |
cc: @FiloSottile @katiehockman re: backporting decision. |
And another fuzz reproduction that caused an OOM "1p10000000000" with a 2.5GiB RAM allocation per https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33286 which is fixed by the change that fixed this. Thank you @griesemer! |
In general, I would vote against backporting fixes that are found by fuzzing if there are no security implications. In this particular case I suppose there might potentially be a security implication if some server accepts user input and passes it to |
The @golang/security team is looking into this. If we determine that there are security implications (which likely there are), then I'll take care of getting this backported and into the next minor release. |
@gopherbot please consider this for backport to 1.15 and 1.16 as this is a security issue. |
Backport issue(s) opened: #46305 (for 1.15), #46306 (for 1.16). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/321831 mentions this issue: |
Change https://golang.org/cl/321832 mentions this issue: |
…t.SetString Found by OSS-Fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33284 Thanks to Emmanuel Odeke for reporting this issue. Updates #45910 Fixes #46305 Fixes CVE-2021-33198 Change-Id: I61e7b04dbd80343420b57eede439e361c0f7b79c Reviewed-on: https://go-review.googlesource.com/c/go/+/316149 Trust: Robert Griesemer <gri@golang.org> Trust: Katie Hockman <katie@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> (cherry picked from commit 6c591f7) Reviewed-on: https://go-review.googlesource.com/c/go/+/321831 Run-TryBot: Katie Hockman <katie@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
…t.SetString Found by OSS-Fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33284 Thanks to Emmanuel Odeke for reporting this issue. Updates #45910 Fixes #46306 Fixes CVE-2021-33198 Change-Id: I61e7b04dbd80343420b57eede439e361c0f7b79c Reviewed-on: https://go-review.googlesource.com/c/go/+/316149 Trust: Robert Griesemer <gri@golang.org> Trust: Katie Hockman <katie@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> (cherry picked from commit 6c591f7) Reviewed-on: https://go-review.googlesource.com/c/go/+/321832 Run-TryBot: Katie Hockman <katie@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
What version of Go are you using (
go version
)?Go since Go1.13 when we added support for hexadecimal literals
Does this issue reproduce with the latest release?
Yes!
What operating system and processor architecture are you using (
go env
)?Not applicable, present on all versions
What did you do?
Found by oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33284, I ran the code in https://play.golang.org/p/pM4ROalIRvq or inlined below
What did you expect to see?
No crash but the boolean value returned as false.
What did you see instead?
A crash resulting from us having passed in
31890781406421892
in make.We should perhaps cap the value that we pass into make to avoid an OOM.
Kindly cc-ing @griesemer @findleyr @katiehockman @rolandshoemaker @FiloSottile
The text was updated successfully, but these errors were encountered: