Skip to content

fix(deps): bump vulnerable Go modules and pin workflow actions to SHAs - #12

Merged
bntvllnt merged 2 commits into
mainfrom
fix/deps-security-2026-11
Nov 17, 2026
Merged

bntvllnt merged 2 commits into
mainfrom
fix/deps-security-2026-11

Conversation

@bntvllnt

@bntvllnt bntvllnt commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Fixes the vulnerable Go modules reported by osv-scanner on main, and pins every GitHub Actions uses: to a full commit SHA. Supersedes dependabot PR #10 (its compress 1.18.7 fixes GO-2026-5841 but not GO-2026-6865, which needs 1.20.2).

Advisories fixed

Module Before After Advisories
github.com/klauspost/compress 1.17.4 1.20.4 GO-2026-5841 / CVE-2026-63209 / GHSA-259r-337f-4rfw (s2 out-of-bounds), GO-2026-6865 / CVE-2026-116591 / GHSA-fpmh-frq8-7rj8 (panic on two-block frames)
github.com/andybalholm/brotli 1.0.6 1.2.8 GO-2026-6888 / CVE-2026-111497 / GHSA-9v8h-qqgm-4m35 / GHSA-c9gr-gmg4-2vqv (excessive memory on crafted streams)
golang.org/x/crypto 0.57.0 0.59.0 GO-2026-5932 (openpgp unmaintained and unsafe by design)
golang.org/x/net 0.60.0 0.62.0 GO-2026-6860 / CVE-2026-78661, GO-2026-6866 / CVE-2026-97045 (html parser/renderer)

compress (zstd) and brotli are imported directly for response decoding, so they stay and are bumped. Each bump is the latest patch in the line that contains the fix; x/crypto uses the tagged release 0.59.0, which is newer than the fixing pseudo-version.

Transitive bumps (from go mod tidy / MVS)

  • golang.org/x/sync 0.23.0 -> 0.25.0
  • golang.org/x/sys 0.48.0 -> 0.50.0
  • golang.org/x/text 0.42.0 -> 0.44.0

go.sum also gains golang.org/x/term 0.46.0 → 0.48.0 (required by x/crypto 0.59.0) and a sum-only entry for github.com/xyproto/randomstring v1.0.5 (used only by brotli's own tests; not in go.mod or the binary). No other modules changed.

Behavior note (brotli 1.2.x): the decoder now returns io.ErrUnexpectedEOF for a br stream that ends before its final block (previously a clean EOF) and is stricter about trailing data. Well-formed responses decode exactly as before; truncated or empty br bodies now surface as decode errors, matching the existing gzip path.

Dependency removal: none removed, all in use

go mod why -m reports every direct require as needed. Single-importer requires were checked for a stdlib replacement and kept:

  • golang.org/x/text/currency: ParseISO validates against the full ISO 4217 table.
  • joho/godotenv: .env quoting and expansion rules.
  • skratchdot/open-golang: per-OS browser launchers.
  • pierrec/xxHash: xxHash64 has no stdlib equivalent.
  • natefinch/lumberjack, atotto/clipboard, x/oauth2, pion/ice, jackc/pgx: real functionality with no stdlib equivalent.

go.etcd.io/bbolt moves from // indirect to a plain require. This is not a new dependency: internal/kvstore already imports it directly, and go mod tidy on current main makes the same change. Real direct imports are unchanged.

Workflow actions pinned

All 35 uses: lines across the 6 workflows now use a 40-char SHA with a trailing version comment. The major version of each action is unchanged.

Action Major (unchanged) Pinned release
actions/checkout v4, v6 v4.4.0, v6.1.0
actions/setup-go v5, v6 v5.6.0, v6.5.0
actions/github-script v7 v7.1.0
actions/cache v4 v4.3.0
actions/upload-artifact v4 v4.6.2
actions/download-artifact v4 v4.3.0
docker/setup-buildx-action v3 v3.12.0
docker/login-action v3 v3.7.0
docker/build-push-action v6 v6.19.2

tj-actions/changed-files is removed rather than pinned (it was compromised in March 2025). pr-path-guard.yml now runs git diff --name-only --no-renames "$BASE...$HEAD" -- internal/translator/ and writes the same any_changed step output, so the failing step behaves as before. The SHAs are passed through env:, not interpolated into the script. I checked the logic on a commit range that touches internal/translator (reports changed) and one that does not (reports unchanged).

Test fixture fix (second commit)

Running the full test suite locally found one regression caused by the klauspost/compress bump, which CI does not catch because the PR build only compiles: TestCaptureRequestInfoDoesNotDecodeASingleSegmentBomb passes on main and failed here with captured 33554470 restored 2062.

  • Cause: the test builds its zstd "bomb" with the library encoder and relied on the encoder's default window. 1.17.4 wrote a 32 MiB window; 1.20.x writes 8 MiB, which equals the decoder's 8 MiB window cap, so the frame was decoded up to the 32 MiB capture bound instead of being left raw.
  • Production code is unchanged: the window cap and the output bound both still apply (memory stays bounded either way).
  • Fix: build the fixture with zstd.WithWindowSize(64<<20) so the encoder emits a real single-segment frame (SingleSegment=true) on every release. Checked on both 1.17.4 and 1.20.4, and the test fails again if the window cap is raised above 64 MiB, so it still guards the behavior.

Verification

  • go mod tidy -diff: no diff. go vet ./...: clean. go build ./cmd/server: ok.
  • go test ./...: 106 packages ok, 28 without test files, 1 failing: internal/discovery TestAdvertiserAndBrowser_Integration (live mDNS multicast discovery). It fails identically on unmodified main in the same environment, so it is not caused by this PR.
  • gofmt -l . lists two files, internal/runtime/executor/claude_thinking_replay_test.go and internal/runtime/executor/codex_stream_bootstrap_buffering_test.go. Both are byte-identical to main, which fails the same way; left untouched.
  • osv-scanner (scan source -r, 40 manifests including the root go.mod): No issues found.
  • osv.dev API lookup on old vs new versions of the seven bumped modules: advisories listed above before, 0 after.
  • Pinned SHAs: each confirmed to exist via the GitHub API; the new path-guard step ran in CI with the correct base/head SHAs and passed.

Bump klauspost/compress 1.17.4 -> 1.20.4, andybalholm/brotli 1.0.6 -> 1.2.8,
golang.org/x/crypto 0.57.0 -> 0.59.0 and golang.org/x/net 0.60.0 -> 0.62.0 to
clear known advisories. go mod tidy also raises x/sync, x/sys and x/text and
marks go.etcd.io/bbolt as a direct requirement (it is already imported directly).

Pin every GitHub Actions `uses:` to a full commit SHA with a version comment.
Replace tj-actions/changed-files in pr-path-guard with a plain git diff step.
…ompress upgrades

TestCaptureRequestInfoDoesNotDecodeASingleSegmentBomb relied on the encoder's
default window, which klauspost/compress lowered to 8 MiB in 1.20.x. That is
exactly the decoder's window cap, so the frame was decoded up to the capture
bound instead of being left raw. Set the window to the content size so the
encoder emits a single-segment frame on every release. Production code is
unchanged.
@bntvllnt
bntvllnt merged commit 0127d7d into main Nov 17, 2026
6 checks passed
@bntvllnt
bntvllnt deleted the fix/deps-security-2026-11 branch November 17, 2026 02:07
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.

1 participant