Skip to content

Clear reachable vulnerabilities in the shipped binary (compress, go-github) - #65

Merged
daniel-garcia merged 1 commit into
ibfrom
vuln-fixes
Sep 18, 2026
Merged

daniel-garcia merged 1 commit into
ibfrom
vuln-fixes

Conversation

@daniel-garcia

Copy link
Copy Markdown

govulncheck -mode binary against the built CLI found two reachable findings. Both are fixed here; the shipped artifact now reports zero reachable vulnerabilities.

Findings

advisory module before after
GO-2026-5841 — OOB read in compress/s2 klauspost/compress v1.18.0, reachable v1.18.7, cleared
GO-2026-5932 — openpgp unmaintained / unsafe by design, no fix available x/crypto via go-github/v39 reachable not linked

go-github dropped its x/crypto dependency at v60; this goes to v92 (current). x/crypto is still in the module graph via other dependencies, but the openpgp package is no longer imported or linked — it drops from a reachable finding to a module-graph-only advisory.

API changes this required

go-github v92 changed the client constructor, so this isn't a pure version bump:

  • NewClient now takes options and returns an error. WithHTTPClient explicitly rejects a nil client, and source/github could previously pass nil (the URL may carry no user info, where v39 silently fell back to http.DefaultClient). The option is now applied only when a client exists, preserving that behaviour rather than turning it into an error.
  • NewEnterpriseClient was removed. source/github_ee composes WithHTTPClient + WithEnterpriseURLs instead.

Verification

Built at the real shipped build tags with Go 1.26.8, then scanned:

=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
  • go build ./..., go vet ./... clean.
  • go test ./source/... ./internal/... . passes, including source/github and source/github_ee.
  • Embedded build info on the scanned binary confirms go-github v92.0.0, compress v1.18.7, go1.26.8.

Two scanning notes worth recording, since both produced misleading results during this work:

  1. A plain govulncheck ./... under-reports for this repo. Every driver sits behind a build tag, so a source scan without the Makefile tag set cannot see them — that's why the compress/s2 finding first appeared only at module level. Use binary mode, or source mode with the full tag set.
  2. Docker layer caching produced a stale scan. A rebuild-and-rescan through docker build still reported openpgp as reachable after the fix, contradicting go mod why and go list -deps. Building directly with the toolchain resolved it. Don't trust a containerised rescan without --no-cache.

Note

Upstream is still on go-github v39, so future upstream merges will conflict on source/github/github.go and source/github_ee/github_ee.go.

Not addressed here: the docker/docker advisories (no fix available, and reachable only through dktesting, which is imported exclusively by _test.go files — never linked into the CLI or library).

🤖 Generated with Claude Code

govulncheck in binary mode against the built CLI reported two reachable
findings; both are addressed here.

* klauspost/compress v1.18.0 -> v1.18.7 fixes GO-2026-5841, an OOB read
  in compress/s2. Reached through compress/zstd and internal/snapref
  rather than by importing s2 directly, which is why a package-level
  dependency listing does not show it.

* go-github v39 -> v92 removes the golang.org/x/crypto/openpgp path
  (GO-2026-5932, unmaintained and unsafe by design, no fix available).
  go-github dropped its x/crypto dependency at v60; v92 is current.
  x/crypto stays in the module graph via other dependencies, but the
  openpgp package is no longer imported or linked.

Two API changes were required. NewClient now takes options and returns
an error, and WithHTTPClient rejects a nil client, so source/github only
passes it when the URL carried user info -- preserving the previous
"defaults to http.DefaultClient" behaviour. NewEnterpriseClient is gone;
source/github_ee composes WithHTTPClient and WithEnterpriseURLs instead.

Verified with a binary built at the shipped build tags using Go 1.26.8:
"No vulnerabilities found", 0 reachable, 1 module-graph-only advisory.

Note this diverges from upstream, which is still on go-github v39, so
future upstream merges will conflict on these two files.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 35295279278

Coverage increased (+0.03%) to 52.649%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 4 uncovered changes across 1 file (11 of 15 lines covered, 73.33%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
source/github/github.go 9 5 55.56%
Total (2 files) 15 11 73.33%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 8437
Covered Lines: 4442
Line Coverage: 52.65%
Coverage Strength: 6424.41 hits per line

💛 - Coveralls

@daniel-garcia
daniel-garcia merged commit 6fa6bab into ib Sep 18, 2026
6 checks passed
@daniel-garcia
daniel-garcia deleted the vuln-fixes branch September 18, 2026 01:48
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