github.com/hashicorp/go-getter/v2 is vulnerable to Path Traversal
53
CVE Score
Medium
Path Traversal
The Get() method of the S3 and GCS getters in go-getter/v2 lists bucket objects matching a Prefix query, computes each object's destination path with filepath.Rel() relative to the requested prefix, and joins that relative path onto the caller's destination directory with filepath.Join() before writing the downloaded object there. Because object keys returned by the storage backend are not validated before this join, a key whose relative path contains ".." segments lets the write escape the intended destination directory during a directory download. The default configuration supplies the destination directory from the getter.Request.Dst field set by the caller invoking a directory-mode S3 or GCS download. The fix adds a containsDotDot() check on the computed relative object path in both s3/get_s3.go and gcs/get_gcs.go, returning an error instead of joining and downloading when the key contains a traversal segment.
Upgrade the github.com/hashicorp/go-getter/v2 package to version 2.2.5 or later.
You are affected if you are using a version that falls within the vulnerable range and perform directory-mode downloads from S3 or GCS buckets with the go-getter/v2 S3 or GCS getters.
2.0.0 - 2.2.4
Fixed in 2.2.5github.com/hashicorp/go-getter/v2 is vulnerable to Path Traversal in versions 2.0.0 - 2.2.4.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.