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

internal/zstd: avoid panic when windowSize is negative #63979

Open
aimuz opened this issue Nov 7, 2023 · 1 comment · May be fixed by #63980
Open

internal/zstd: avoid panic when windowSize is negative #63979

aimuz opened this issue Nov 7, 2023 · 1 comment · May be fixed by #63980
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@aimuz
Copy link
Contributor

aimuz commented Nov 7, 2023

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

$ go version
devel

Does this issue reproduce with the latest release?

yes

What did you do?

Window_Size should have the same value range as Frame_Content_Size, when Frame_Content_Size exceeds the maximum value of int64, it will cause Window_Size to become negative.
According to RFC 8878, Frame_Content_Size can be any value from 1 to 2^64-1 bytes (16 EB).

Testing with the following values will trigger this issue, resulting in a panic

go test fuzz v1
[]byte("(\xb5/\xfd\xe40000000\xfa20\x000")

What did you expect to see?

What did you see instead?

aimuz added a commit to aimuz/go that referenced this issue Nov 7, 2023
Consistency of Window_Size and Frame_Content_Size value ranges as
per RFC 8878 3.1.1.1.2 to resolve panic issues.

Fixes golang#63979
@aimuz aimuz linked a pull request Nov 7, 2023 that will close this issue
@gopherbot
Copy link

Change https://go.dev/cl/540415 mentions this issue: internal/zstd: avoid panic when windowSize is negative

@heschi heschi added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 7, 2023
@heschi heschi added this to the Go1.22 milestone Nov 7, 2023
aimuz added a commit to aimuz/go that referenced this issue Nov 9, 2023
Consistency of Window_Size and Frame_Content_Size value ranges as
per RFC 8878 3.1.1.1.2 to resolve panic issues.

Fixes golang#63979
aimuz added a commit to aimuz/go that referenced this issue Nov 9, 2023
Consistency of Window_Size and Frame_Content_Size value ranges as
per RFC 8878 3.1.1.1.2 to resolve panic issues.

Fixes golang#63979
aimuz added a commit to aimuz/go that referenced this issue Nov 11, 2023
Consistency of Window_Size and Frame_Content_Size value ranges as
per RFC 8878 3.1.1.1.2 to resolve panic issues.

Fixes golang#63979
aimuz added a commit to aimuz/go that referenced this issue Nov 12, 2023
Consistency of Window_Size and Frame_Content_Size value ranges as
per RFC 8878 3.1.1.1.2 to resolve panic issues.

Fixes golang#63979
aimuz added a commit to aimuz/go that referenced this issue Nov 18, 2023
Consistency of Window_Size and Frame_Content_Size value ranges as
per RFC 8878 3.1.1.1.2 to resolve panic issues.

Fixes golang#63979
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.

3 participants