Skip to content

Update Go module dependencies and version - #172

Merged
anhthii merged 2 commits into
fystack:masterfrom
Azzurriii:chore/go-1.27-cve-fixes
Oct 29, 2026
Merged

anhthii merged 2 commits into
fystack:masterfrom
Azzurriii:chore/go-1.27-cve-fixes

Conversation

@Azzurriii

@Azzurriii Azzurriii commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Upgrades the Go toolchain from 1.25.8 to 1.27.3 and refreshes the golang.org/x/* dependencies to clear the vulnerabilities reported by govulncheck. It also fixes two CI jobs that the upgrade broke or that were already failing.

Changes

Toolchain and dependencies

  • go.mod and e2e/go.mod: go 1.27.3.
  • golang.org/x/{crypto,net,sys,text,term}, otel, klauspost/compress, testify and related modules bumped, then go mod tidy.
  • GO_VERSION in ci.yml and e2e-tests.yml, plus the Dockerfile builder image, set to 1.27.3.
  • Docs updated to the new minimum Go version: README.md, INSTALLATION.md, k8s instructions, systemd README.

CI: security scan

  • Count only the distinct vulnerabilities whose vulnerable code is actually called:
    jq -n '[inputs | select(.finding.trace[0].function != null) | .finding.osv] | unique | length'
  • Remove duplicate stacks, codeFlows and rule tags entries from the SARIF file before upload, so GitHub accepts it.

CI: lint

  • golangci/golangci-lint-action@v6 → @v9, with golangci-lint pinned to v2.15.0 instead of latest, so a future major release can't break CI unexpectedly.
  • New .golangci.yml in v2 format:
    • The comments, common-false-positives, legacy and std-error-handling exclusion presets, which roughly match v1's built-in exclusions.
    • ST1005 (error strings shouldn't be capitalised) is disabled for now. Changing those strings changes the error messages clients see, so it belongs in its own PR.
    • SA1019 is excluded only for ecdsa.PublicKey.X/.Y (see below).

Fixes for new lint findings (no behaviour change)

  • examples/: removed defer natsConn.Drain(). It was deferred before defer natsConn.Close(), so it always ran after Close and immediately returned ErrConnectionClosed, doing nothing.
  • pkg/eventconsumer: the keygen goroutines already handle their errors and only need to tell the caller that something failed. The channel now carries struct{} instead of an error that was received and then ignored.
  • staticcheck quick fixes: fmt.Fprintf instead of WriteString(fmt.Sprintf(...)), De Morgan's law, and shorter selectors for embedded fields.

crypto/ecdsa.PublicKey.X/.Y deprecation (Go 1.26)

The stdlib now steers people away from the raw coordinates, towards PublicKey.Bytes, ParseUncompressedPublicKey and crypto/ecdh. Those APIs only support NIST curves, and for other curves the stdlib suggests a third-party module. Following that advice:

Location Curve Change
pkg/client/kms_signer_test.go P-256 Compare keys with PublicKey.Equal instead of comparing X/Y
examples/hdwallet/ecdsa secp256k1 Verify signatures with btcec/v2/ecdsa instead of crypto/ecdsa with raw coordinates
pkg/mpc, pkg/encoding, pkg/ckdutil tests secp256k1 / Ed25519 Unchanged, lint warning excluded. tss-lib returns ecdsa.PublicKey and its API needs X/Y. The fields are deprecated but not removed, and moving off them means migrating away from tss-lib types, which is out of scope here.

Type of change

  • Security fix (dependency / toolchain update)
  • CI / build
  • Refactor (no functional change)
  • New feature
  • Breaking change

How has this been tested?

  • govulncheck ./...: 0 vulnerabilities in the main module and in e2e (run with -test).
  • go build ./..., go vet ./... and go test ./... pass.
  • golangci-lint run (v2.15.0, --max-same-issues=0 --max-issues-per-linter=0): 0 issues.
  • Re-ran the new jq steps on the SARIF and JSON from the failed CI run:
    • The count step reports 30, matching govulncheck's "Your code is affected by 30 vulnerabilities".
    • The SARIF still has all 68 results, and none contain duplicate entries.

Checklist

  • My code follows the style of this project
  • I have run the linter and tests locally
  • I have updated the documentation where needed
  • No new warnings are introduced; the remaining exclusions are documented in .golangci.yml

Notes for reviewers

  • e2e/base_test.go:65 already fails go vet because a context cancel function is never called. This PR leaves it alone.
  • The govulncheck step still has continue-on-error: true. Results go to the Security tab and don't block CI, as before.

- Bump Go version from 1.25.8 to 1.27.3
- Update dependencies:
  - github.com/stretchr/testify from v1.11.1 to v1.12.1
  - golang.org/x/crypto from v0.48.0 to v0.58.0
  - golang.org/x/term from v0.40.0 to v0.47.0
  - github.com/go-logr/logr from v1.4.3 to v1.4.4
  - github.com/klauspost/compress from v1.18.4 to v1.20.3
  - go.opentelemetry.io/otel and related packages from v1.39.0 to v1.47.0
  - go.yaml.in/yaml/v3 from v3.0.4 to v3.0.5
  - golang.org/x/net from v0.49.0 to v0.61.0
  - golang.org/x/sys from v0.42.0 to v0.49.0
  - golang.org/x/text from v0.34.0 to v0.43.0
  - golang.org/x/sync from v0.19.0 to v0.24.0
  - golang.org/x/mod from v0.32.0 to v0.41.0
- Remove indirect dependency on github.com/pmezard/go-difflib
@socket-security

socket-security Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang.org/​x/​crypto@​v0.48.0 ⏵ v0.58.074 +1100 +75100100100
Updatedgithub.com/​stretchr/​testify@​v1.11.1 ⏵ v1.12.189 -6100100100100
Updatedgolang.org/​x/​term@​v0.40.0 ⏵ v0.47.0100 +1100100100100

View full report

- Upgrade golangci-lint to v2.15.0 and change action version to v9
- Add .golangci.yml configuration for linters
- Refactor benchmark report generation to use fmt.Fprintf for consistency
- Update Go version in systemd README from 1.27.1 to 1.27.3
- Remove unnecessary natsConn.Drain() calls in multiple examples
- Fix public key handling in tests and encoding
- Change error handling channel to a struct channel for better clarity
@sonarqubecloud

Copy link
Copy Markdown

@anhthii
anhthii merged commit 4062584 into fystack:master Oct 29, 2026
21 checks passed
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