security: bump golang.org/x/net to v0.57.0 and klauspost/compress to v1.18.7 - #2
Draft
nitinpunn-attention wants to merge 1 commit into
Draft
security: bump golang.org/x/net to v0.57.0 and klauspost/compress to v1.18.7#2nitinpunn-attention wants to merge 1 commit into
nitinpunn-attention wants to merge 1 commit into
Conversation
…v1.18.7 Closes GHSA-5cv4-jp36-h3mw (CVE-2026-25680, medium) on golang.org/x/net, plus 23 further advisories that Dependabot did not raise. golang.org/x/net v0.49.0 -> v0.57.0. Dependabot's floor of 0.55.0 is not sufficient: GO-2026-5942 (CVE-2026-46600, dns/dnsmessage) is fixed only in 0.56.0 and has no GHSA record, so it generates no alert. v0.57.0 is the latest stable release and clears all 8 x/net advisories. It also lifts x/crypto v0.47.0 -> v0.54.0 (13 advisories, 7 critical), x/sys v0.40.0 -> v0.47.0 and x/text v0.34.0 -> v0.40.0 in the resolved graph. github.com/klauspost/compress v1.18.0 -> v1.18.7 closes GO-2026-5841 (OOB read in compress/s2), the only baseline finding whose affected package is actually compiled here. v1.18.7 is a security-only release; v1.19.x was deliberately not taken because it adds new arm64 assembly to the zstd and huff0 decode paths that this repository has no test coverage for. The go directive moves 1.24.0 -> 1.25.0. This is forced, not chosen: every release that fixes these advisories declares go 1.25.0, and "go mod tidy -go=1.24.0" fails. Crossing into 1.25 flips five GODEBUG defaults (containermaxprocs, updatemaxprocs, decoratemappings, tlssha1, x509sha256skid) for any module whose own go directive reaches 1.25. No application-code changes. go build, go vet, go test, go test -race, go mod verify, go mod tidy -diff and gofmt all pass locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the one open Dependabot alert, plus 23 further advisories that Dependabot never raised, by moving
golang.org/x/netto v0.57.0 andgithub.com/klauspost/compressto v1.18.7. Onlygo.modandgo.sumchange. There are no application-code changes.Two things a reviewer should read before anything else:
golang.org/x/netis not sufficient. GO-2026-5942 (CVE-2026-46600) is fixed only in 0.56.0 and has no GHSA record, so it generates no alert. The existingdependabot/go_modules/golang.org/x/net-0.55.0branch would leave it open.godirective moves from 1.24.0 to 1.25.0, and that is forced, not chosen. Details and consumer impact are in their own section below. This repository is a public Go module, so that change is visible downstream.Baseline and freshness
675144ba5114a6777a28bc86f11db3c708d5ad93(fetchedorigin/main, 2026-08-08)git rev-list --left-right --count main...origin/mainreturned0 0. Branch was cut from the freshly fetchedorigin/main, not from local HEADgit status --porcelainempty)gh api repos/attentiontech/walstream-go/dependabot/alerts?state=open. No inherited inventory was usedhttps://proxy.golang.org,direct, GOFLAGS emptyNote: tag
v0.3.0points at675144b, somainis the currently released version. No tag was created or pushed by this change, and none should be until a maintainer decides to cut a release.Alert-by-alert disposition
Open Dependabot alerts at baseline: 1 medium, 0 low, 0 high, 0 critical.
golang.org/x/net(transitive,go.mod, runtime scope)< 0.55.0The advisory was checked for
withdrawn_at(null) and its fullvulnerabilitieslist was read (one entry, no other package mapping).Applicability note, stated in both directions so it is not overread or underread: the affected import path is
golang.org/x/net/html, and nogolang.org/x/netpackage is compiled by this module.go list -deps -test ./...returns zero packages undergolang.org/x/net, andgo mod why golang.org/x/net/htmlreturns "main module does not need package golang.org/x/net/html".go mod why -m golang.org/x/netshows the requirement exists only becausegithub.com/segmentio/kafka-go's own test binary importsgolang.org/x/net/nettest. The fix still matters because this is a public library: itsgo.modis a minimum-version floor for every downstream consumer under MVS, and at 0.49.0 this module was actively holding consumers down onto a vulnerablex/net.Advisories Dependabot did not raise (found by graph sweep)
Spec-mandated sweep of the whole resolved graph, not just the alert list. Sources: GitHub
/advisories?ecosystem=go&affects=..., OSV/v1/query, and the Go vulnerability database (vuln.go.devindex plus per-ID records). Module paths and package import paths and every intermediate prefix were swept, because Go advisories are frequently keyed to package paths that a module-path-only query misses.Coverage: 20 of 20 module/version pairs in the baseline build list (100 percent), 91 distinct sweep queries, 72 compiled external packages enumerated.
Baseline: 25 distinct applicable advisories. Only 1 of them had an alert.
golang.org/x/netv0.49.0golang.org/x/cryptov0.47.0github.com/klauspost/compressv1.18.0golang.org/x/sysv0.40.0golang.org/x/textv0.34.0golang.org/x/netv0.49.0 detail: GO-2026-4918 (http2), GO-2026-5025 / 5027 / 5028 / 5029 / 5030 (html), GO-2026-5026 (idna), GO-2026-5942 (dns/dnsmessage).golang.org/x/cryptov0.47.0 detail, all fixed in 0.52.0, allssh,ssh/agentorssh/knownhosts: GHSA-jppx-rxg9-jmrx, GHSA-f5wc-c3c7-36mc, GHSA-vgwf-h737-ff37, GHSA-rm3j-f69w-wqmq, GHSA-89gr-r52h-f8rx, GHSA-5cgq-3rg8-m6cv, GHSA-x527-x647-q7gg (critical); GHSA-q4h4-gmj2-qvw2, GHSA-w879-237q-wc7r (high); GHSA-45gg-vh54-h5m9, GHSA-78mq-xcr3-xm33, GHSA-qpw4-5x99-6vjp, GHSA-9m57-25v3-79x9 (medium).github.com/klauspost/compressGO-2026-5841 / GHSA-259r-337f-4rfw, range>= 1.16.0, < 1.18.7, affected importgithub.com/klauspost/compress/s2, symbols2.NewDict. This is the only baseline finding whose affected package is actually compiled into this module (viakafka-go/compress/snappy).gh api /advisories/GHSA-259r-337f-4rfwreturns HTTP 404 andaffects=github.com/klauspost/compressreturns 0 records, so I could not find this advisory in GitHub's global advisory database on 2026-08-08, which is consistent with no alert being filed. OSV, the Go vulnerability database, andgovulncheckall carry it.Dependency changes
golang.org/x/netgo.mod)github.com/klauspost/compressgo.mod)golang.org/x/cryptogo.modgolang.org/x/sysgolang.org/x/termgolang.org/x/textgolang.org/x/mod,golang.org/x/sync,golang.org/x/toolsgodirectiveNo module was downgraded. Every entry in the resolved build list stayed equal, went up, or was pruned out. Verified by comparing
go list -m allbefore and after with a semver comparator.Not changed, deliberately:
github.com/segmentio/kafka-gostays at v0.4.50 (v0.4.51 exists, released 2026-04-23) andgithub.com/pierrec/lz4/v4stays at v4.1.15. Neither carries an applicable advisory, both are compiled into the runtime path, and this repository has no test that exercises a Kafka broker or a compression round trip. Bundling them would add behavioral risk with no security benefit.Version selection rationale
golang.org/x/netv0.57.0, which is the latest stable release (2026-07-08, one month old at time of writing). Measured advisory exposure per candidate, scored against GHSA and OSV with an evaluator that reads the full event list:v0.56.0 would have been sufficient. v0.57.0 was taken per the latest-stable-in-the-maintained-major rule, after confirming it introduces nothing new, that it is not a prerelease, that
golang.org/x/netcarries no retractions, and that it is a month old rather than days old.github.com/klauspost/compressv1.18.7, which is deliberately NOT the latest stable. This is a departure from the default and the reason is specific. v1.18.7's release notes read in full: "Fix s2.NewDict OOB read. Security release without other changes." The v1.19.x line, by contrast, added true concurrent zstd stream encoding, new arm64 decoder assembly for zstd and huff0, flate inflate checkpoints, and several zstd dictionary changes. v1.19.2, released three days ago on 2026-08-05, is itself fixing "arm64 asm frame offsets placing locals on the saved LR slot" in that new assembly and re-enabling "unsafe decodeSync memory copies". This module compileszstd,huff0,flate,s2andsnappythrough kafka-go, and has zero tests covering any of them, so a three-day-old minor carrying newly-fixed stack-frame bugs in hand-tuned assembly is a worse trade than the pure security patch. v1.18.7 is the last release on the 1.18 line and carries no known advisory. v1.19.x also carries no known advisory per OSV, so upgrading further later is a clean follow-up whenever there is test coverage to justify it.No major version upgrades were performed, so no migration guide applies.
The
godirective change, and what it means for consumersgo 1.24.0becomesgo 1.25.0. This is not a stylistic bump.It is forced.
go mod tidy -go=1.24.0with x/net v0.57.0 required exits 1 with:I fetched the
.modfile of every release that fixes any of these advisories fromproxy.golang.orgon 2026-08-08, and every one of them declaresgo 1.25.0: x/net 0.55.0 / 0.56.0 / 0.57.0, x/crypto 0.51.0 through 0.54.0, x/text 0.38.0 through 0.40.0, x/sys 0.43.0 through 0.47.0. Across those candidates I could not find a remediation path that keepsgo 1.24.0.GODEBUG baseline. Crossing from 1.24 into 1.25 flips exactly five settings, read from
/usr/local/go/src/internal/godebugs/table.go(entries withChanged: 25):containermaxprocs0updatemaxprocs0decoratemappings0tlssha11x509sha256skid0GODEBUG defaults are taken from the main module's
godirective, so for a program that merely imports this library the consumer's own directive governs, not this one. These flips therefore bind this repository's own test and tool builds directly.But it does reach consumers indirectly, and I measured it. A synthetic consumer module declaring
go 1.24.0:go build ./...exits 0 and the consumer'sgo.modis untouchedgo build ./...in the default readonly mode exits 1 withgo: updates to go.mod needed; to update it: go mod tidy, and under-mod=modit succeeds but rewrites the consumer's owngo 1.24.0togo 1.25.0, which then flips those five settings for the consumerSo consumers on
go 1.24will have to move togo 1.25. Context for that ask:https://go.dev/doc/devel/releasestates "Each major Go release is supported until there are two newer major releases", Go 1.26.0 was released 2026-02-10, andhttps://go.dev/dl/?mode=jsonlists go1.26.5 and go1.25.12 as the current stable releases as of 2026-08-08. Go 1.24 is therefore already outside the supported window and Go 1.25 is inside it.I did not add
godebugdirectives to pincontainermaxprocsorupdatemaxprocs.godebuglines only take effect in the main module'sgo.mod, so in a library they would be inert for every consumer while silently changing only this repository's own test runs. Flagging the flip is the honest action here; pinning it would look like a mitigation without being one. If maintainers want the pin for this repository's own builds, that is a deliberate follow-up decision, not something to smuggle into a dependency bump.Application-code changes
None. Risk tier: not applicable.
git diff --statisgo.mod | 7 +++----andgo.sum | 12 ++++++------.Validation
Every command was run bare with its output redirected to a file and its exit status captured on the next statement. Nothing below is derived from a pipeline.
go mod verifyall modules verifiedgo mod tidy -diffgo build ./...go vet ./...go test ./... -count=1streamingok 1.283s,streaming/typesok 1.358s, 3 packages have no test filesgo test -race ./... -count=1streamingok 1.857s,streaming/typesok 1.217sgofmt -l .git status --porcelainM go.mod,M go.sumonlyPre-existing failures: none. The identical command set was run first against a pristine
git archiveextract of675144binto an empty directory, and all of it was green there too, includinggo mod tidy -diffat 0 lines. Baselines were taken from that extract rather than from a working tree that tools had already touched.govulncheck(~/go/bin/govulncheck v1.6.0, database snapshot 2026-07-27, which was 12 days stale on the day of this run, hence the GHSA and OSV cross-checks above):mimeandosfrom the toolchainmimeandosonlyNo other vulnerabilities found.The three called findings are GO-2026-5856
crypto/tls(fixed go1.26.5), GO-2026-5039net/textproto(fixed go1.26.4) and GO-2026-5037crypto/x509(fixed go1.26.4). They are properties of the toolchain that ran the scan, not of anything ingo.mod, they are identical before and after, and no dependency change can clear them. They are cleared by building with go1.26.4 or newer. Reported here rather than omitted.After the change
govulncheckreports the modules it scanned as walstream-go,klauspost/compress@v1.18.7,lz4/v4@v4.1.15andkafka-go@v0.4.50.x/netandx/cryptoare absent from that list, which independently corroborates that no package from either is built.Projected remaining applicable vulnerabilities
Full sweep of the proposed graph: 17 of 17 module/version pairs checked (100 percent), 88 distinct queries.
25 distinct applicable advisories at baseline, 1 remaining.
The remaining one is GO-2026-5932, "The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues". Its OSV range is
events: [{"introduced": "0"}]with nofixedevent, so as recorded on 2026-08-08 it applies to every published version ofgolang.org/x/crypto, and I could not find a version that clears it. Its affected import paths (golang.org/x/crypto/openpgpand friends) do not appear ingo list -deps -test ./..., so it is not applicable at package level in this repository. It is reported, not counted as resolved and not suppressed.Reviewer focus
godirective. This is the one judgment call that a maintainer should confirm rather than a reviewer rubber-stamp. It is forced by the fix, it is consumer-visible, and it flips five GODEBUG defaults for anyone whose owngo.modgets rewritten to 1.25.0.go mod tidydropped the explicitgolang.org/x/text v0.34.0 // indirectline, because once x/net v0.57.0 supplies a higher requirement no explicit entry is needed. Inside this repository x/text rises from v0.34.0 to v0.40.0, which clears GO-2026-5970. For a downstream consumer that importsgolang.org/x/textand pins nothing itself, I measured the floor this module imposes dropping from v0.34.0 to v0.23.0. That is not a new advisory: v0.23.0 and v0.34.0 carry exactly the same single applicable advisory (GO-2026-5970, fixed 0.39.0), so exposure is unchanged. It is still a floor reduction and worth a maintainer's opinion. I did not hand-add the requirement back becausego mod tidystrips it again, which would makego mod tidy -diffred.klauspost/compressv1.18.7 instead of v1.19.2. Deliberate, reasoned above. Reject it if you would rather take the latest, but please do so knowing the arm64 assembly in v1.19.x had a stack-frame bug fixed three days ago and nothing in this repository's test suite would catch a regression there.dependabot/go_modules/golang.org/x/net-0.55.0proposes a version that leaves GO-2026-5942 open.Unrun validation and remaining uncertainty
675144bon 2026-08-08.git ls-tree -r origin/mainreturns no path beginning with.github,gh api .../contents/.github/dependabot.ymlreturns HTTP 404, andgh api .../actions/workflowsreturns only the two GitHub-generated dynamic Dependabot workflows. On that evidence, opening this pull request runs no repository-authored CI, there is nothing tag-triggered in this repository, and every claim in this description comes from a command run locally.streamingandstreaming/typesare covered;client,streaming/kafkaandtypeshave no test files. Nothing exercises a live Kafka broker, TLS, SASL or a compression round trip. Theklauspost/compressbump touches code that is compiled but never executed by any test in this repository. That is the largest unmeasured surface in this change.govulncheckwas 12 days old. GHSA and OSV were queried live on 2026-08-08 to compensate, and OSV is the source that carries GO-2026-5942 and GO-2026-5841.Rollback
git revertthe single commit, or restorego.modandgo.sumfrom675144b. There are no application-code changes, no generated files, no vendored tree and no lockfile beyondgo.sum, so revert is complete and total. A consumer whose owngo.modwas rewritten togo 1.25.0by building against this branch will not be reverted automatically and would need to lower its own directive by hand.Branch protection context
mainis governed by an active repository ruleset (id 15087352) requiring a pull request with 1 approving review, dismissing stale reviews on push, and blocking deletion and non-fast-forward pushes. The classic/branches/main/protectionendpoint returns 404, which is not evidence that the branch is unprotected. No ruleset applies to this branch.