Skip to content

cmd/go: go mod verify does not verify modules with replace directive #79942

Description

@nicholashusin

This came in as a security report originally (http://b/522253058 internally). But, we don't really see a practical way to exploit this. Therefore, classifying this is a public security hardening bug, rather than a vulnerability.


When a module is replaced in go.mod like so:

module example.com

go 1.26

require rsc.io/quote v1.5.2

replace rsc.io/quote v1.5.2 => rsc.io/quote v1.5.1

go mod verify fails to verify the replaced module, even if the local cached version has been modified.

Metadata

Metadata

Assignees

Labels

GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.help wanted

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions