]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.25] 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 16:29:36 +0000 (09:29 -0700)
commit2899144b8d80e8d73274c04fb39a36d3a54658dd
tree3f4a5ea21a42e1608fc8e2aeec7ebbca3b29ac2b
parentb062eb46e8e76ad39029d0c1b13e4eb81c692c20
[release-branch.go1.25] 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: I95b619588ecb6661770aa4e1d6023d6cb22e2263
Reviewed-on: https://go-review.googlesource.com/c/go/+/686338
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
TryBot-Bypass: 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