Skip to content

chore: Update dependencies to address CVEs#3754

Merged
melekes merged 27 commits intov0.34.xfrom
pkg-updates-checkmarx-cves
Aug 20, 2024
Merged

chore: Update dependencies to address CVEs#3754
melekes merged 27 commits intov0.34.xfrom
pkg-updates-checkmarx-cves

Conversation

@melekes
Copy link
Collaborator

@melekes melekes commented Aug 19, 2024

Author: AlexsandroRyan

This pull request addresses all CVEs reported by the Checkmarx tool during its execution on this repository.

The previous discussion can be found here: https://github.com/cometbft/cometbft/discussions/3558.

I have updated all necessary dependencies to fix the identified CVEs, but some vulnerabilities remain unresolved. I would appreciate any assistance in addressing these remaining issues.

  1. CVE-2021-3538: This issue is related to the github.com/satori/go.uuid package, which is a dependency of tm-load-test. We have already submitted a PR to address this: Replace vulnerable satori/go.uuid with google/uuid informalsystems/tm-load-test#221.

  2. CVE-2024-24786: This vulnerability pertains to the google.golang.org/protobuf package. Running go mod graph | grep google.golang.org/protobuf reveals that many packages are using the vulnerable version. It’s unclear if updating them individually is feasible.

  3. CVE-2024-34478: This vulnerability is associated with github.com/btcsuite/btcd, a dependency of github.com/btcsuite/btcd/btcutil, which is currently used at a version lower than 0.24.0. We have also submitted a pull request for this: Updated btcd dependency of btcutil to address CVE-2024-34478 btcsuite/btcd#2235.

Please let us know if this approach is sufficient or if there is a more efficient way to resolve these issues.


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

AlexsandroRyan and others added 17 commits August 13, 2024 14:54
Updated the dependency with the command:
go get github.com/btcsuite/btcd/btcutil

Relevant package updated:
go: upgraded github.com/btcsuite/btcd v0.23.0 => v0.23.5-0.20231215221805-96c9fd8078fd
Updated the dependency with the command:
go get go get github.com/moby/buildkit

Relevant package updated:
go: upgraded github.com/moby/buildkit v0.10.4 => v0.15.1
Found the corresponding dependency:
go mod graph | grep github.com/nats-io/nats-server/v2
> github.com/go-kit/kit@v0.12.0 github.com/nats-io/nats-server/v2@v2.5.0

Updated the dependency with the command:
go get github.com/go-kit/kit

The dependency updated after updating:
go mod graph | grep github.com/nats-io/nats-server/v2
> github.com/go-kit/kit@v0.13.0 github.com/nats-io/nats-server/v2@v2.8.4
Change was performed in line 100 of go.mod file in commit 960870c

Checking updated dependency:
go mod graph | grep github.com/emicklei/go-restful
> github.com/containerd/containerd@v1.7.19 github.com/emicklei/go-restful/v3@v3.10.1
…2024-23653

We've update the github.com/moby/buildkit to newer version in the
commit 960870c, but then verified there's one dependency using old
buildkit version(this means that CVE-2024-23653 wasn't addressed):
go mod graph | grep github.com/moby/buildkit
> github.com/bufbuild/buf@v1.9.0 github.com/moby/buildkit@v0.10.4

Updated github.com/bufbuild/buf version to latest and newer version
doesn't use buildkit anymore.
…22-24450

Update of the github.com/go-kit/kit to v0.13.0 in commit
f5787ef addressed the CVE-2022-24450

Check:
go mod graph | grep github.com/nats-io/nats-server/v2
> github.com/go-kit/kit@v0.13.0 github.com/nats-io/nats-server/v2@v2.8.4
Updated the dependency with the command:
go get github.com/adlio/schema

Check:
go mod graph | grep github.com/docker/docker
> github.com/tendermint/tendermint github.com/docker/docker@v27.0.3+incompatible
> github.com/adlio/schema@v1.3.6 github.com/docker/docker@v24.0.9+incompatible
> github.com/bufbuild/buf@v1.36.0 github.com/docker/docker@v27.0.0+incompatible
> github.com/bufbuild/buf@v1.36.0 github.com/docker/docker-credential-helpers@v0.8.2
> github.com/moby/buildkit@v0.15.1 github.com/docker/docker@v27.0.3+incompatible
> github.com/moby/buildkit@v0.15.1 github.com/docker/docker-credential-helpers@v0.8.2
Change was performed in line 218 of go.mod file in commit a20047a

Checking updated dependency:
go mod graph | grep github.com/opencontainers/runc
> github.com/adlio/schema@v1.3.6 github.com/opencontainers/runc@v1.1.12
Change was performed in line 218 of go.mod file in commit a20047a

Checking updated dependency:
go mod graph | grep github.com/opencontainers/runc
> github.com/adlio/schema@v1.3.6 github.com/opencontainers/runc@v1.1.12
Change was performed in line 218 of go.mod file in commit a20047a

Checking updated dependency:
go mod graph | grep github.com/opencontainers/runc
> github.com/adlio/schema@v1.3.6 github.com/opencontainers/runc@v1.1.12
…23651

Run command:
go get github.com/btcsuite/btcd/btcutil@v1.1.6

Output:
go: upgraded github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd => v0.24.2
@melekes melekes requested a review from a team as a code owner August 19, 2024 07:53
@melekes melekes mentioned this pull request Aug 19, 2024
4 tasks
@melekes
Copy link
Collaborator Author

melekes commented Aug 19, 2024

cc @AlexsandroRyan

@melekes
Copy link
Collaborator Author

melekes commented Aug 19, 2024

GHSA-33m6-q9v5-62r7: This issue is related to the github.com/satori/go.uuid package, which is a dependency of tm-load-test. We have already submitted a PR to address this: informalsystems/tm-load-test#221.

Thanks for the PR 🙏 Ported it to cometbft/cometbft-load-test#32. It will be released in v0.2.0

@melekes melekes changed the title Update dependencies to address CVEs chore: Update dependencies to address CVEs Aug 19, 2024
@melekes melekes self-assigned this Aug 19, 2024
@melekes melekes added the dependencies Dependency updates label Aug 19, 2024
```
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/runtime/time.go:174:17: cannot range over 3 (untyped int constant)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/reflect/iter.go:67:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/reflect/iter.go:75:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/reflect/iter.go:131:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/reflect/iter.go:139:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/reflect/type.go:2320:19: cannot range over num (variable of type int)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/slices/iter.go:50:17: cannot range over seq (variable of type iter.Seq[E])
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/unique/clone.go:76:12: cannot range over atyp.Len (variable of type uintptr)
Error: /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.0.linux-amd64/src/maps/iter.go:51:20: cannot range over seq (variable of type iter.Seq2[K, V])
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants