Skip to content

Bump Go toolchain to 1.25.11 to resolve std-lib security vulnerabilities - #153

Open
shayanshafii wants to merge 2 commits into
mainfrom
devin/1782714467-go-1-25-11-stdlib-vulns
Open

shayanshafii wants to merge 2 commits into
mainfrom
devin/1782714467-go-1-25-11-stdlib-vulns

Conversation

@shayanshafii

@shayanshafii shayanshafii commented Jun 29, 2026

Copy link
Copy Markdown

Summary

A Snyk SCA scan flagged the Go standard library (built at go 1.23.7) with 10 HIGH-severity vulnerabilities. These are fixed by building against a patched Go toolchain. This PR bumps the go directive — and the matching CI/Docker Go pins — to 1.25.11, the smallest stable patch that clears every reported HIGH.

go.mod   go 1.23.7  -> go 1.25.11
Dockerfile  golang:1.24.4-alpine -> golang:1.25.11-alpine

Why 1.25.11 (not 1.24.x or latest 1.26.x)

The 1.24 line is EOL for these CVEs — std/mime, std/net, std/net/http fixes were not backported, so 1.24.x cannot clear all HIGHs. 1.25.11 is the lowest patch where every reported HIGH is fixed (per the Snyk fix versions below), so it's the smallest viable bump.

HIGHs resolved (all in the Go std lib)

Package Issue Snyk fix version (1.25 line)
std/crypto/x509 Uncaught Exception + 3× resource exhaustion 1.25.2 / 1.25.3 / 1.25.9 / 1.25.11
std/mime Resource exhaustion 1.25.11
std/net Double free; Uncaught Exception 1.25.10
std/net/http Sensitive info exposure; Infinite loop 1.24.4 / 1.25.10
std/net/url Resource exhaustion 1.24.12

CI / lint change

golangci-lint v2.1 is built with go1.24 and hard-fails to load any module whose language version is ≥ 1.25 (config load error, not findings). So .github/workflows/lint.yml is updated to:

  • golangci-lint v2.1v2.5.0 (built with go1.25, supports the 1.25 language version)
  • setup-go go-version: stablego-version-file: "go.mod", matching every other workflow so the lint job tracks go.mod.

The other workflows (go.yml, license-check.yml, docs-check.yml, goreleaser.yml) already use go-version-file: "go.mod", and code-scanning.yml resolves the version from the environment, so they pick up 1.25.11 automatically. No Dockerfile multi-stage or distroless runtime change needed beyond the build image.

Verification

Local, with the go1.25.11 toolchain:

  • go build ./... — pass
  • go test ./... — pass
  • golangci-lint run (v2.5.0) — 0 issues

Snyk npx snyk test --all-projects (go.mod std-lib version drives the std findings):

HIGH Medium Low Total issues Vulnerable paths
Before (go 1.23.7) 10 15 1 26 161
After (go 1.25.11) 0 1 0 1 2

All 10 std-lib HIGHs are resolved. The single remaining Medium is in the third-party dependency github.com/go-viper/mapstructure/v2 (log-injection) — unrelated to the Go toolchain and out of scope for this change.

Tradeoffs

  • No go.sum changes (module graph pruning is identical for ≥1.17 modules).
  • Pinned golangci-lint to an exact v2.5.0 rather than latest (v2.12.x); newer golangci-lint adds new gosec/staticcheck/govet rules that would surface unrelated findings, so the oldest go1.25-compatible release keeps this PR focused on the security bump.

Link to Devin session: https://app.devin.ai/sessions/737542c0b74f418cb2042a646f39a83b
Requested by: @shayanshafii


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)
Open in Devin Review

Snyk flagged the Go standard library at 1.23.7 with 10 HIGH-severity vulns in std/crypto/x509, std/mime, std/net, std/net/http, and std/net/url. Bumping the go directive to 1.25.11 (the smallest patch that clears all reported HIGHs) builds against a patched std lib.

Also bump golangci-lint to v2.5.0 (built with go1.25) so the linter supports the new language version, and pin the lint workflow's Go to go.mod.

Co-Authored-By: shayan <shayan@cognition.ai>
Copilot AI review requested due to automatic review settings June 29, 2026 06:28
@shayanshafii shayanshafii self-assigned this Jun 29, 2026
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Co-Authored-By: shayan <shayan@cognition.ai>
@sonarqubecloud

Copy link
Copy Markdown

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