chore(deps): 升级 Go 工具链至 1.25 并修复 x/crypto Critical CVE - #3
Conversation
Socket 在 PR #1 报出 8 项 Critical CVE,全部位于 golang.org/x/crypto/ssh(< 0.52.0,其中 GHSA-v778-237x-gjrc 需 >= 0.31.0)。 该包经 gin@v1.10.0 -> prometheus/client_golang@v1.20.5 传递引入 x/crypto v0.24.0,扫描按依赖图告警。 变更: - go directive: 1.22 -> 1.25.0 - golang.org/x/crypto: v0.24.0 -> v0.55.0 - 伴生依赖随之抬升:x/net v0.57.0、x/sys v0.47.0、x/text v0.41.0 - 直接依赖(gin/client_golang/testify)未变动 版本选择:修复线为 0.52.0;v0.55.0 是 Go 1.25 下可用的最高版本 (v0.56.0 起要求 go 1.26.0)。 验证:go mod tidy 无进一步改动;go build/vet/test 全部通过, 并使用 GOTOOLCHAIN=go1.25.0 复跑(与 CI 的 go-version-file 行为一致)。 说明:SDK 实际编译进的 x/crypto 包仅 sha3 与 TLS 相关密码学原语, crypto/ssh 未进入二进制,本次升级以消除扫描告警、对齐依赖基线为主。 Co-Authored-By: Claude Code <noreply@anthropic.com>
Welcome To opensourceways CommunityHey @TangJia025 , thanks for your contribution to the community. Bot Usage ManualI'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. Contact GuideIf you have any questions, please contact the SIG: infratructure , |
CLA Signature PassTangJia025, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Linking Issue Notice@TangJia025 , the pull request must be linked to at least one issue. |
原写「Go 取 go/go.mod 的版本(1.22)」,但 #3 已把 go.mod 升到 1.25.0, 括号里的数字当场过期。改为只说明来源(CI 用 go-version-file 读 go.mod), 避免每次升 Go 都要回来改文档。 Co-Authored-By: Claude Code <noreply@anthropic.com>
背景
Socket(SocketSecurity)在 PR #1 报出 8 项 Critical CVE,全部位于传递依赖
golang.org/x/crypto/ssh(< 0.52.0;其中GHSA-v778-237x-gjrc的修复线为>= 0.31.0)。引入链:PR #1 已合入 main,该版本仍然停留在
v0.24.0,本 PR 处理它。变更
go/go.mod/go/go.sum:go 1.22go 1.25.0golang.org/x/cryptov0.24.0v0.55.0golang.org/x/netv0.26.0v0.57.0golang.org/x/sysv0.22.0v0.47.0golang.org/x/textv0.16.0v0.41.0后三项是
x/crypto顺带抬升的伴生依赖。直接依赖(gin / client_golang / testify)未变动。版本选择说明
0.52.0,v0.55.0已全部覆盖。v0.55.0:x/crypto自v0.56.0起要求go 1.26.0,本 PR 目标为 Go 1.25,故v0.55.0是该工具链下可用的最高修复版本。go directive必须同步升至 1.25:x/crypto v0.52.0+要求go 1.25.0,仅升依赖会在 Go 1.22 下报module requires go >= 1.25.0。验证
CI 使用
go-version-file: go/go.mod,会按 directive 精确安装 Go 1.25.0。为对齐该行为,另以GOTOOLCHAIN=go1.25.0复跑同一套测试,结果一致。影响与风险
go-version-file自动切到 1.25.0,工作流无需改动。golang.org/x/crypto/ssh,而 SDK 实际编译进二进制的 x/crypto 包仅有sha3与 TLS 相关密码学原语(经validator/v10引入),源码中无任何crypto/ssh引用,go list -deps中 ssh 包计数为 0。即告警在依赖图上存在,但在本 SDK 内不存在可利用路径。本次升级以消除扫描告警、对齐依赖基线为主要目的。🤖 Generated with Claude Code
AI 使用声明
当前 PR 是否有 AI 参与: