-
Notifications
You must be signed in to change notification settings - Fork 18k
index/suffixarray: oom in Read #52813
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
This one is similar to #52120. I don't think this is a bug either. The invalid data passed to import (
"encoding/binary"
"fmt"
)
func ExampleVarint() {
// the first 10 bytes holds the number of the items in the suffix array
x, _ := binary.Varint([]byte{0xf4, 0xee, 0xfe, 0xff, 0x23, 0x0, 0x0, 0xb, 0x2d, 0x10})
fmt.Println(x)
// Output:
// 4831828922
} |
Here is an example of a oom fix : https://go-review.googlesource.com/c/go/+/400378/ But I am okay if it is not considered a bug |
You are right that we have varying degrees of "robust with respect to bad input" in the stdlib. That CL was for a package that reads external files, which may come from any source (not just Go). Conceivably an adversary might invent a PE file and convince your Go code to try and read it.
|
👍 Thanks for the details |
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?
Run https://go.dev/play/p/ArMJGdfERMY
What did you expect to see?
The program finishing and printing Hello
What did you see instead?
Nothing (because of oom)
Profile shows up
Found by https://github.com/catenacyber/ngolo-fuzzing on oss-fuzz
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46673
Is this a bug ?
The text was updated successfully, but these errors were encountered: