Fix all Snyk go.mod vulnerabilities: Go toolchain 1.26.7 + mapstructure v2.4.0 - #159
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
…ure to v2.4.0 Co-Authored-By: shayan <shayan@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…third-party license reports Co-Authored-By: shayan <shayan@cognition.ai>
Co-Authored-By: shayan <shayan@cognition.ai>
|
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.




Closes: n/a (Snyk remediation)
Removes every open-source vulnerability Snyk reports for
go.mod. No source code changes.What changed
go.mod:go 1.23.7→go 1.26.7. Nearly all findings were Go standard library CVEs attributed to the Go version Snyk reads fromgo.mod(std/net/http,std/net/url,std/net,std/crypto/x509,std/os,std/mime,std/os/exec,std/syscall,std/html/template). The highest fix threshold across the reported issues was 1.25.13 / 1.26.6, so 1.26.7 (current patch of a supported release line) clears all of them.go.mod/go.sum:github.com/go-viper/mapstructure/v22.3.0 → 2.4.0 — the only non-stdlib finding (SNYK-GOLANG-GITHUBCOMGOVIPERMAPSTRUCTUREV2-12177854, medium).Dockerfile: build stagegolang:1.24.4-alpine→golang:1.26.7-alpine, so the image actually compiles with the patched toolchain instead of downloading it at build time.third-party-licenses.{linux,darwin,windows}.md: one line each, the mapstructure version in the generated license report (required byscript/licenses-check).CI installs Go via
go-version-file: go.modand so builds, tests and license-checks with 1.26.7.A
toolchain go1.26.7directive with thegodirective left at 1.23.7 was tried first (to keep the pinned linter happy) and does not work:setup-gothen installs 1.23.7 as GOROOT while thegocommand switches to the 1.26.7 toolchain, andgo-licensesfails to load stdlib packages under that mismatch (Package errors does not have module info), breakinglicense-check. Reproduced locally with GOROOT 1.24.0 +toolchain go1.26.7.Before / after (
snyk test --all-projects, gomodules / go.mod)Before:
found 30 issues, 202 vulnerable paths. After:no vulnerable paths found. (The Snyk UI aggregates vulnerable paths rather than issues, which is where the 92 high / 107 medium figure comes from; both go to zero.) Snyk Code reported no findings.Fixed high-severity issues (all
std/*@ 1.23.7, attributed togo.mod)Also fixed (medium/low, same mechanism): SNYK-GOLANG-STDCRYPTOX509-14545540/-14545541/-15928852, SNYK-GOLANG-STDHTMLTEMPLATE-15440731/-16535164/-16535165/-18858461/-15928853 (low), SNYK-GOLANG-STDNETHTTP-14546365, SNYK-GOLANG-STDNETURL-14546349/-15440727, SNYK-GOLANG-STDOS-14548505/-15236034/-15440726, SNYK-GOLANG-STDOSEXEC-14552249, SNYK-GOLANG-STDSYSCALL-14548504, plus the mapstructure issue above.
Verification
go build ./...,go test ./...,go vet ./...— all pass with Go 1.26.7snyk test --all-projects— no vulnerable pathsscript/licenses-checkdiff (the initial CI failure) resolved by the license report updateNot fixed / follow-ups
golang:1.24.4-alpinewas scanned with 9 critical / 45 high OS vulnerabilities. This PR moves the build stage togolang:1.26.7-alpine, which should cut most of that, but the image's OS package set was not re-scanned here — worth a dedicatedsnyk container testpass.gcr.io/distroless/base-debian12reports 43 low and no critical/high; no action recommended.lintCI job fails and needs a separate change (not done here):.github/workflows/lint.ymlpinsgolangci-linttov2.1, resolving to v2.1.6, whose binary is built with go1.24 and therefore refuses any module targeting a newer Go version:can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.26.7). Anygo.modGo version high enough to clear the stdlib CVEs (≥ 1.25.13) hits this. Bumping the pin to a binary built with go1.27 (v2.13.2) makes the config load, but that release surfaces 9 pre-existing findings in files this PR does not touch —pkg/github/secret_scanning.go(4× gosec G117),internal/githubv4mock/query.go(2× govetinline),cmd/github-mcp-server/generate_docs.goandpkg/github/issues.go(3× staticcheck QF1012). Fixing those (or#nosec-ing the gosec ones) is out of scope for a dependency-security PR, so the linter bump is left as a follow-up.Analyze (go)/Analyze (actions): fail atcodeql database initwithError getting package versions 'github/ccr-go-queries' / 'github/ccr-actions-queries' to the public GitHub Container registry: HTTP/1.1 403 Forbidden … permission_denied: read_package— a code-scanning configuration/permission issue in this fork, independent of this PR's contents. SonarCloud likewise fails before analysis (no accessible job log; external check configuration)..snykignores or suppressions were added, and no tests were modified.go.sumchurn is limited to the mapstructure entries (4 lines); there is no lockfile regeneration in this PR.Link to Devin session: https://app.devin.ai/sessions/56219133623f4adc90f76a62f059b1d7
Open in Devin Desktop: https://app.devin.ai/desktop/session/56219133623f4adc90f76a62f059b1d7?variant=devin
Requested by: @shayanshafii
Devin Review