Skip to content

chore: Update dependencies to address CVEs - #3754

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

melekes merged 27 commits into
v0.34.xfrom
pkg-updates-checkmarx-cves

Conversation

@melekes

@melekes melekes commented Aug 19, 2024 •

Copy link
Copy Markdown
Collaborator

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/[email protected] github.com/nats-io/nats-server/[email protected]

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/[email protected] github.com/nats-io/nats-server/[email protected]
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/[email protected] github.com/emicklei/go-restful/[email protected]
…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/[email protected] github.com/moby/[email protected]

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/[email protected] github.com/nats-io/nats-server/[email protected]
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/[email protected]+incompatible
> github.com/adlio/[email protected] github.com/docker/[email protected]+incompatible
> github.com/bufbuild/[email protected] github.com/docker/[email protected]+incompatible
> github.com/bufbuild/[email protected] github.com/docker/[email protected]
> github.com/moby/[email protected] github.com/docker/[email protected]+incompatible
> github.com/moby/[email protected] github.com/docker/[email protected]
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/[email protected] github.com/opencontainers/[email protected]
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/[email protected] github.com/opencontainers/[email protected]
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/[email protected] github.com/opencontainers/[email protected]
…23651

Run command:
go get github.com/btcsuite/btcd/[email protected]

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

melekes commented Aug 19, 2024

Copy link
Copy Markdown
Collaborator Author

cc @AlexsandroRyan

@melekes

melekes commented Aug 19, 2024

Copy link
Copy Markdown
Collaborator Author

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
Comment thread go.mod Resolved
```
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/runtime/time.go:174:17: cannot range over 3 (untyped int constant)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/reflect/iter.go:67:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/reflect/iter.go:75:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/reflect/iter.go:131:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/reflect/iter.go:139:19: cannot range over v.Len() (value of type int)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/reflect/type.go:2320:19: cannot range over num (variable of type int)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/slices/iter.go:50:17: cannot range over seq (variable of type iter.Seq[E])
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/src/unique/clone.go:76:12: cannot range over atyp.Len (variable of type uintptr)
Error: /home/runner/go/pkg/mod/golang.org/[email protected]/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