]> Cypherpunks repositories - gostls13.git/commit
cmd/go: disable support for multiple vcs in one module
authorRoland Shoemaker <bracewell@google.com>
Mon, 9 Jun 2025 18:23:46 +0000 (11:23 -0700)
committerCarlos Amedee <carlos@golang.org>
Tue, 8 Jul 2025 18:30:38 +0000 (11:30 -0700)
commit54c9d776302d53ab1907645cb67fa4a948e1500c
tree11915488ec36cdc3e5a2d6000b9a55e2d1d50e3c
parentfca43a8436f2dbec981fb002c6ba31fe9ff89dd6
cmd/go: disable support for multiple vcs in one module

Removes the somewhat redundant vcs.FromDir, "allowNesting" argument,
which was always enabled, and disallow multiple VCS metadata folders
being present in a single directory. This makes VCS injection attacks
much more difficult.

Also adds a GODEBUG, allowmultiplevcs, which re-enables this behavior.

Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc for reporting this issue.

Fixes #74380
Fixes CVE-2025-4674

Change-Id: I5787d90cdca8deb3aca6f154efb627df1e7d2789
Reviewed-on: https://go-review.googlesource.com/c/go/+/686515
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Commit-Queue: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
doc/godebug.md
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modfetch/repo.go
src/cmd/go/internal/vcs/vcs.go
src/cmd/go/internal/vcs/vcs_test.go
src/cmd/go/testdata/script/test_multivcs.txt [new file with mode: 0644]
src/cmd/go/testdata/script/version_buildvcs_nested.txt
src/internal/godebugs/table.go
src/runtime/metrics/doc.go