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

vendor: google.golang.org/protobuf v1.33.0, github.com/golang/protobuf v1.5.4 #4773

Closed
wants to merge 0 commits into from

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Mar 18, 2024

full diffs:

From the Go security announcement list;

Version v1.33.0 of the google.golang.org/protobuf module fixes a bug in
the google.golang.org/protobuf/encoding/protojson package which could cause
the Unmarshal function to enter an infinite loop when handling some invalid
inputs.

This condition could only occur when unmarshaling into a message which contains
a google.protobuf.Any value, or when the UnmarshalOptions.UnmarshalUnknown
option is set. Unmarshal now correctly returns an error when handling these
inputs.

This is CVE-2024-24786.

In a follow-up post;

A small correction: This vulnerability applies when the UnmarshalOptions.DiscardUnknown
option is set (as well as when unmarshaling into any message which contains a
google.protobuf.Any). There is no UnmarshalUnknown option.

In addition, version 1.33.0 of google.golang.org/protobuf inadvertently
introduced an incompatibility with the older github.com/golang/protobuf
module. (golang/protobuf#1596) Users of the older
module should update to github.com/golang/protobuf@v1.5.4.

govulncheck results shows that the solver/errdefs may hit this code:

govulncheck ./...
Scanning your code and 821 packages across 157 dependent modules for known vulnerabilities...

=== Symbol Results ===

Vulnerability #1: GO-2024-2611
    Infinite loop in JSON unmarshaling in google.golang.org/protobuf
  More info: https://pkg.go.dev/vuln/GO-2024-2611
  Module: google.golang.org/protobuf
    Found in: google.golang.org/protobuf@v1.31.0
    Fixed in: google.golang.org/protobuf@v1.33.0
    Example traces found:
      #1: solver/errdefs/solve.go:73:25: errdefs.Solve.UnmarshalJSON calls jsonpb.Unmarshal, which eventually calls json.Decoder.Peek
      #2: solver/errdefs/solve.go:73:25: errdefs.Solve.UnmarshalJSON calls jsonpb.Unmarshal, which eventually calls json.Decoder.Read
      #3: solver/errdefs/solve.go:73:25: errdefs.Solve.UnmarshalJSON calls jsonpb.Unmarshal, which eventually calls protojson.UnmarshalOptions.Unmarshal

Your code is affected by 1 vulnerability from 1 module.
This scan found no other vulnerabilities in packages you import or modules you
require.
Use '-show verbose' for more details.

@thaJeztah thaJeztah changed the title vendor: google.golang.org/protobuf v1.33.0, github.com/golang/protobu… vendor: google.golang.org/protobuf v1.33.0, github.com/golang/protobuf v1.5.4 Mar 18, 2024
@thaJeztah thaJeztah added the dependencies Pull requests that update a dependency file label Mar 18, 2024
go.mod Outdated
@@ -99,7 +99,7 @@ require (
golang.org/x/time v0.3.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.33.0
Copy link
Member

@crazy-max crazy-max Mar 18, 2024

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, containerd should also be updated; that said, I'm not sure if that should always be the rule; it's a direct dependency here. We had a quick chat about this in the Moby maintainers call last Thursday (as we updated this dependency in Moby); consensus there was that we had enough coverage in the moby repository to validate it worked, so we went ahead and merged the update.

@thaJeztah
Copy link
Member Author

Ah, looks like these were already updated since, and now were a no-op

@thaJeztah thaJeztah deleted the bump_protobuf branch April 9, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants