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

Do not use zstd.Decoder.DecodeAll on untrusted data #27

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

mostynb
Copy link
Owner

@mostynb mostynb commented Jun 6, 2024

Otherwise, malicious peers could DoS us with decompression bombs.

This issue was uncovered during a security audit performed by 7ASecurity, facilitated by OSTIF, for the OpenTelemetry project.

https://opentelemetry.io/blog/2024/cve-2024-36129/ GHSA-c74f-6mfw-mm4v

@jpkrohling
Copy link

Would it be possible to also publish an advisory from this repo, so that consumers of the library will get automatically notified by GitHub (dependabot), as well as third-party security vulnerability scanners?

@mostynb
Copy link
Owner Author

mostynb commented Jun 6, 2024

Would it be possible to also publish an advisory from this repo, so that consumers of the library will get automatically notified by GitHub (dependabot), as well as third-party security vulnerability scanners?

Will do, once I figure out how :)

wrapper := &decoderWrapper{Decoder: decoder}
runtime.SetFinalizer(wrapper, func(dw *decoderWrapper) {
err := dw.Reset(nil)
if err != nil {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be err == nil

Otherwise, malicious peers could DoS us with decompression bombs.

This issue was uncovered during a security audit performed by 7ASecurity,
facilitated by OSTIF, for the OpenTelemetry project.

https://opentelemetry.io/blog/2024/cve-2024-36129/
GHSA-c74f-6mfw-mm4v
@mostynb mostynb merged commit 629c44d into main Jun 6, 2024
2 checks passed
@mostynb mostynb deleted the avoid_zstd_decodeall_dos branch June 6, 2024 12:07
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
mostynb added a commit to mostynb/bazel-remote that referenced this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants