SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223
Record from snyk · Published May 25, 2022
github.com/hashicorp/go-getter is fixed in 1.6.1 (Go Modules)
## Overview [github.com/hashicorp/go-getter](https://pkg.go.dev/github.com/hashicorp/go-getter/v2) is a Package for downloading things from a string URL using a variety of protocols. Affected versions of this package are vulnerable to Command Injection via hg argument injection. When calling the `new(gogetter.HgGetter).get()` function, the `dst` parameter is passed to the `hg clone` command in a way that additional flags can be set. The additional flags can be used to perform a command injection. ## PoC ```go package main import ( gogetter "github.com/hashicorp/go-getter" "net/url" ) func main(){ g := new(gogetter.HgGetter) rawURL := "someurl" u, _ := url.Parse(rawURL) dst := "--config=alias.clone=!touch ./HELLO" g.Get(dst, u) } ``` ## Remediation Upgrade `github.com/hashicorp/go-getter` to version 1.6.1, 2.1.0 or higher. ## References - [GitHub Commit](https://github.com/hashicorp/go-getter/commit/38e97387488f5439616be60874979433a12edb48) - [HashiCorp Discuss](https://discuss.hashicorp.com/t/hcsec-2022-13-multiple-vulnerabilities-in-go-getter-library/39930)
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| github.com/hashicorp/go-getter | Go Modules | 1.6.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| 0 |
Timeline
- Mar 11, 2022 CVE Updated
- May 25, 2022 CVE Published
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223
vulnetix vdb fixes SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223 advisory
- https://learn.snyk.io/lesson/malicious-code-injection/ technical
- https://pkg.go.dev/github.com/hashicorp/go-getter/v2 vendor
- https://github.com/hashicorp/go-getter/commit/38e97387488f5439616be60874979433a12edb48 patch
- https://discuss.hashicorp.com/t/hcsec-2022-13-multiple-vulnerabilities-in-go-getter-library/39930 technical