Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependency "github.com/pelletier/go-toml" #62

Closed
Ben131-Go opened this issue Feb 4, 2023 · 1 comment
Closed

Upgrade dependency "github.com/pelletier/go-toml" #62

Ben131-Go opened this issue Feb 4, 2023 · 1 comment

Comments

@Ben131-Go
Copy link

Background

Repo github.com/pluveto/upgit depends on github.com/pelletier/go-toml/v2@v2.0.0-beta.6.

https://github.com/pluveto/upgit/blob/main/go.mod#L9

However, comparing version v2.0.0-beta.6 of github.com/pelletier/go-toml from proxy.golang.org and github, there are inconsistencies.

commit time of the copy on github.com

"committer": {
      "name": "GitHub",
      "email": "noreply@github.com",
      "date": "2022-04-07T23:51:09Z"
    }

commit time of the copy on proxy.golang.org

{"Version":"v2.0.0-beta.6","Time":"2022-01-01T01:03:18Z"}

So the checksum from the code in github does not match the checksum saved in sum.golang.org. The v2.0.0-beta.6 tag of github.com/pelletier/go-toml might have been retagged after a minor edition on github. I guess you use proxy.golang.org to get dependencies, but that also shows that your project is depending on the copy of github.com/pelletier/go-toml@v2.0.0-beta.6 before its edition. Depending upon such inconsistent tag version may also result in some unexpected errors as well as build errors due to different proxy settings.

For example, when someone who does not use proxy.golang.org, say GOPROXY=direct, attempts to get github.com/pelletier/go-toml/v2@v2.0.0-beta.6, the following error occurs.

go: downloading github.com/pelletier/go-toml/v2 v2.0.0-beta.6
go: github.com/pelletier/go-toml/v2@v2.0.0-beta.6: verifying module: checksum mismatch
        downloaded: h1:wURrrr62LqAzIR22w6KSpuDTdzPljPWc5UrtWOsWPfU=
        sum.golang.org: h1:JFNqj2afbbhCqTiyN16D7Tudc/aaDzE2FBDk+VlBQnE=

SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

So, this is a reminder in the hope that you can get rid of this problematic version of project github.com/pelletier/go-toml.

Solution

1. Bump the version of dependency github.com/pelletier/go-toml

I would recommend bumping the version of github.com/pelletier/go-toml to a new release to ensure dependency copy in proxy.golang.org and github in sync.

References

@pluveto
Copy link
Owner

pluveto commented Feb 13, 2023

Resolved.

@pluveto pluveto closed this as completed Feb 13, 2023
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

No branches or pull requests

2 participants